Subject: | from gborg: won't compile |
[this bug has been migrated from Gborg]
quote.c cannot be compiled, using native IRIX C compiler. On line 415 is construction "string++", where "string" variable is declared as "void*". As far as this is unkwnown object for compiler, it refuse to compile. Solution is very simply, for example to declare temporary variable "tstring" of "char*" type and assign the "string" value to "tstring". And replace the occurance of "string" with "tstring" in for loop. Diff follows:
--- quote.c Thu Feb 19 03:34:36 2004
+++ quote.c.mod Tue Aug 31 14:01:46 2004
@@ -392,6 +392,7 @@
size_t *retlen;
{
char *result;
+ char *tstring;
char *dest;
int max_len = 0, i;
@@ -411,8 +412,11 @@
dest = result;
memcpy(dest++, "X'",1);
- for (i=0 ; i <= len ; ++i, dest+=2)
- sprintf(dest, "%X", *((char*)string++));
+ tstring = (char*)string;
+
+ for (i=0 ; i <= len ; ++i, dest+=2) {
+ sprintf(dest, "%X", *((char*)tstring++));
+ }
strcat(dest, "\'");