Revision: 14711 Author: adrian.chadd Date: Wed Jun 9 19:36:31 2010 Log: Actually -set- the buffer pointer 'end' in strtol_n().
This fixes the random "can't parse content-length" issues I started seeing on the JP cacheboy mirror node. http://code.google.com/p/lusca-cache/source/detail?r=14711 Modified: /branches/LUSCA_HEAD/lib/util.c ======================================= --- /branches/LUSCA_HEAD/lib/util.c Sat May 15 03:08:08 2010 +++ /branches/LUSCA_HEAD/lib/util.c Wed Jun 9 19:36:31 2010 @@ -771,7 +771,6 @@ { char buf[64]; long r; - char *np = NULL; int l = MIN(nlen, sizeof(buf) - 1); /* take a copy of the string, NUL terminate it just in case */ @@ -779,11 +778,11 @@ buf[l] = '\0'; /* Now do the parsing */ - r = strtol(buf, &np, base); + r = strtol(buf, endptr, base); /* The endptr is relative to buf, so convert back if required */ - if (np != NULL) { - np = (char *) nptr + (np - buf); + if ((*endptr) != NULL) { + (*endptr) = (char *) nptr + ((*endptr) - buf); } return r; -- You received this message because you are subscribed to the Google Groups "lusca-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/lusca-commit?hl=en.
