summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2023-03-05 19:22:47 +0000
committerChristos Zoulas <christos@zoulas.com>2023-03-05 19:22:47 +0000
commit029b82459eff7074425cfcbda7c3ce07bb9ce32d (patch)
tree567ce286d31423e49486aaa1b4772123155d52be
parentc49972ddb4933ee6edc4a2abc7f36f6a42d47300 (diff)
downloadfile-git-029b82459eff7074425cfcbda7c3ce07bb9ce32d.tar.gz
PR/431: Barteks2x: If we failed to convert to utf8, don't return an error.
-rw-r--r--src/ascmagic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ascmagic.c b/src/ascmagic.c
index 487f55dd..7677f0c4 100644
--- a/src/ascmagic.c
+++ b/src/ascmagic.c
@@ -35,7 +35,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: ascmagic.c,v 1.113 2022/12/26 17:31:14 christos Exp $")
+FILE_RCSID("@(#)$File: ascmagic.c,v 1.114 2023/03/05 19:22:47 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -148,8 +148,10 @@ file_ascmagic_with_encoding(struct magic_set *ms, const struct buffer *b,
goto done;
}
if ((utf8_end = encode_utf8(utf8_buf, mlen, ubuf, ulen))
- == NULL)
+ == NULL) {
+ rv = 0;
goto done;
+ }
buffer_init(&bb, b->fd, &b->st, utf8_buf,
CAST(size_t, utf8_end - utf8_buf));