[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS shishi/gl
From: |
shishi-commit |
Subject: |
CVS shishi/gl |
Date: |
Sat, 25 Mar 2006 21:37:35 +0100 |
Update of /home/jas/self/public-cvs/shishi/gl
In directory latte:/home/jas/self/src/shishi/gl
Modified Files:
base64.c setenv.c time_r.c unsetenv.c
Log Message:
Update.
--- /home/jas/self/public-cvs/shishi/gl/base64.c 2006/01/12 17:17:52
1.8
+++ /home/jas/self/public-cvs/shishi/gl/base64.c 2006/03/25 20:37:27
1.9
@@ -1,5 +1,6 @@
/* base64.c -- Encode binary data using printable characters.
- Copyright (C) 1999, 2000, 2001, 2004, 2005, 2006 Free Software Foundation,
Inc.
+ Copyright (C) 1999, 2000, 2001, 2004, 2005, 2006 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -73,7 +74,7 @@
while (inlen && outlen)
{
- *out++ = b64str[to_uchar (in[0]) >> 2];
+ *out++ = b64str[(to_uchar (in[0]) >> 2) & 0x3f];
if (!--outlen)
break;
*out++ = b64str[((to_uchar (in[0]) << 4)
@@ -108,8 +109,8 @@
return, the OUT variable will hold a pointer to newly allocated
memory that must be deallocated by the caller. If output string
length would overflow, 0 is returned and OUT is set to NULL. If
- memory allocation fail, OUT is set to NULL, and the return value
- indicate length of the requested memory block, i.e.,
+ memory allocation failed, OUT is set to NULL, and the return value
+ indicates length of the requested memory block, i.e.,
BASE64_LENGTH(inlen) + 1. */
size_t
base64_encode_alloc (const char *in, size_t inlen, char **out)
@@ -135,8 +136,10 @@
}
*out = malloc (outlen);
- if (*out)
- base64_encode (in, inlen, *out, outlen);
+ if (!*out)
+ return outlen;
+
+ base64_encode (in, inlen, *out, outlen);
return outlen - 1;
}
@@ -287,6 +290,9 @@
# define uchar_in_range(c) ((c) <= 255)
#endif
+/* Return true if CH is a character from the Base64 alphabet, and
+ false otherwise. Note that '=' is padding and not considered to be
+ part of the alphabet. */
bool
isbase64 (char ch)
{
@@ -381,11 +387,11 @@
size of the decoded data is stored in *OUTLEN. OUTLEN may be NULL,
if the caller is not interested in the decoded length. *OUT may be
NULL to indicate an out of memory error, in which case *OUTLEN
- contain the size of the memory block needed. The function return
+ contains the size of the memory block needed. The function returns
true on successful decoding and memory allocation errors. (Use the
*OUT and *OUTLEN parameters to differentiate between successful
- decoding and memory error.) The function return false if the input
- was invalid, in which case *OUT is NULL and *OUTLEN is
+ decoding and memory error.) The function returns false if the
+ input was invalid, in which case *OUT is NULL and *OUTLEN is
undefined. */
bool
base64_decode_alloc (const char *in, size_t inlen, char **out,
--- /home/jas/self/public-cvs/shishi/gl/setenv.c 2006/03/13 13:42:08
1.8
+++ /home/jas/self/public-cvs/shishi/gl/setenv.c 2006/03/25 20:37:27
1.9
@@ -13,9 +13,9 @@
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <alloca.h>
--- /home/jas/self/public-cvs/shishi/gl/time_r.c 2006/03/13 13:42:08
1.5
+++ /home/jas/self/public-cvs/shishi/gl/time_r.c 2006/03/25 20:37:27
1.6
@@ -26,14 +26,6 @@
#include <string.h>
-static char *
-copy_string_result (char *dest, char const *src)
-{
- if (! src)
- return 0;
- return strcpy (dest, src);
-}
-
static struct tm *
copy_tm_result (struct tm *dest, struct tm const *src)
{
--- /home/jas/self/public-cvs/shishi/gl/unsetenv.c 2006/03/13 13:42:08
1.6
+++ /home/jas/self/public-cvs/shishi/gl/unsetenv.c 2006/03/25 20:37:27
1.7
@@ -13,9 +13,9 @@
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif