Fix formatting of strings with unknown size

This commit is contained in:
Jeremy Lakeman 2014-02-12 13:08:13 +10:30
parent 0727fb3b62
commit 37e4d65b2a

2
str.c
View File

@ -905,7 +905,7 @@ size_t strn_fromprint(unsigned char *dst, size_t dstsiz, const char *src, size_t
unsigned char *const odst = dst;
unsigned char *const edst = dst + dstsiz;
const char *const esrc = srclen ? src + srclen : NULL;
while (src < esrc && *src && *src != endquote && dst < edst) {
while ((src < esrc || !esrc) && *src && *src != endquote && dst < edst) {
switch (*src) {
case '\\':
++src;