]> arthur.barton.de Git - netatalk.git/blobdiff - etc/papd/lp.c
compute the right size if len == -1 in convert_string and use -1 than strlen(in)...
[netatalk.git] / etc / papd / lp.c
index 033571b3733b94204092d164c8dc096c7566c77c..e077a8d5b03fb3d86d12d03b57c6d9c16b9dc866 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: lp.c,v 1.30 2009-10-16 01:10:59 didg Exp $
+ * $Id: lp.c,v 1.32 2009-10-29 11:35:58 didg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -127,7 +127,7 @@ static void convert_octal (char *string, charset_t dest)
     char temp[4];
     long int ch;
 
-    q=p=string;
+    q=p=(unsigned char *)string;
     while ( *p != '\0' ) {
         ch = 0;
         if ( *p == '\\' ) {
@@ -164,7 +164,7 @@ static void translate(charset_t from, charset_t dest, char **option)
     if (*option != NULL) {
         convert_octal(*option, from);
         if (from) {
-             if ((size_t) -1 != (convert_string_allocate(from, dest, *option, strlen(*option), &translated)) ) {
+             if ((size_t) -1 != (convert_string_allocate(from, dest, *option, -1, &translated)) ) {
                  free (*option);
                  *option = translated;
              }