gsasl-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS gsasl/gl


From: gsasl-commit
Subject: CVS gsasl/gl
Date: Mon, 13 Dec 2004 00:32:34 +0100

Update of /home/cvs/gsasl/gl
In directory dopio:/tmp/cvs-serv23035/gl

Modified Files:
        iconvme.c iconvme.h 
Log Message:
Update.

--- /home/cvs/gsasl/gl/iconvme.c        2004/12/10 21:44:12     1.2
+++ /home/cvs/gsasl/gl/iconvme.c        2004/12/12 23:32:33     1.3
@@ -36,9 +36,13 @@
 # include <iconv.h>
 #endif
 
+/* Convert a zero-terminated string from one code set to another.  The
+   returned string is allocated using malloc, and must be dellocated
+   by the caller using free.  On failure, NULL is returned and errno
+   holds the error reason.  Note that this function does not handle
+   embedded zero's in the output well.  */
 char *
 iconv_z (const char *to_codeset, const char *from_codeset, const char *str)
-
 {
   char *dest = NULL;
 #if HAVE_ICONV
@@ -80,7 +84,7 @@
     goto out;
   outbytes_remaining = outbuf_size - 1;        /* -1 for NUL */
 
- again:
+again:
 
   err = iconv (cd, (ICONV_CONST char **) &p, &inbytes_remaining,
               &outp, &outbytes_remaining);
@@ -129,7 +133,7 @@
   if (*p != '\0')
     have_error = 1;
 
- out:
+out:
   iconv_close (cd);
 
   if (have_error)
@@ -137,6 +141,8 @@
       free (dest);
       dest = NULL;
     }
+#else
+  errno = ENOSYS;
 #endif
 
   return dest;
--- /home/cvs/gsasl/gl/iconvme.h        2004/12/10 20:48:10     1.1
+++ /home/cvs/gsasl/gl/iconvme.h        2004/12/12 23:32:33     1.2
@@ -19,7 +19,7 @@
 #ifndef ICONVME_H
 # define ICONVME_H
 
-extern char *
-iconv_z (const char *to_codeset, const char *from_codeset, const char *str);
+extern char *iconv_z (const char *to_codeset, const char *from_codeset,
+                     const char *str);
 
 #endif /* ICONVME_H */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]