summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/util.c b/util.c
index 2ee9c0ef90..fc245836d0 100644
--- a/util.c
+++ b/util.c
@@ -302,14 +302,13 @@ I32 *retlen;
from++;
}
}
- else if (*from == delim) {
- if (to < toend)
- *to = '\0';
+ else if (*from == delim)
break;
- }
if (to < toend)
*to++ = *from;
}
+ if (to < toend)
+ *to = '\0';
*retlen = tolen;
return from;
}