diff options
author | Christos Zoulas <christos@zoulas.com> | 2022-08-17 08:47:47 +0000 |
---|---|---|
committer | Christos Zoulas <christos@zoulas.com> | 2022-08-17 08:47:47 +0000 |
commit | b556ee126ef6e063e5660e7c0a56bc7daea6b1fb (patch) | |
tree | 9db98d04227ff91887395482d82d4d579678b4c4 | |
parent | f8426d776649a99b962e5b2fa41fe105e4e48f14 (diff) | |
download | file-git-b556ee126ef6e063e5660e7c0a56bc7daea6b1fb.tar.gz |
PR/374: piru: avoid infinite loop in non-wide code
-rw-r--r-- | src/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: file.c,v 1.202 2022/07/26 15:10:05 christos Exp $") +FILE_RCSID("@(#)$File: file.c,v 1.203 2022/08/17 08:47:47 christos Exp $") #endif /* lint */ #include "magic.h" @@ -675,7 +675,7 @@ file_mbswidth(struct magic_set *ms, const char *s) s += bytesconsumed, n -= bytesconsumed; } #else - while (*s) { + for (; *s; s++) { width += (ms->flags & MAGIC_RAW) != 0 || isprint(CAST(unsigned char, *s)) ? 1 : 4; } |