mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 10:46:23 +00:00
Fix formatting of strings with unknown size
This commit is contained in:
parent
0727fb3b62
commit
37e4d65b2a
2
str.c
2
str.c
@ -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 odst = dst;
|
||||||
unsigned char *const edst = dst + dstsiz;
|
unsigned char *const edst = dst + dstsiz;
|
||||||
const char *const esrc = srclen ? src + srclen : NULL;
|
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) {
|
switch (*src) {
|
||||||
case '\\':
|
case '\\':
|
||||||
++src;
|
++src;
|
||||||
|
Loading…
Reference in New Issue
Block a user