summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2021-02-07 23:43:48 +0200
committerTimo Teräs <timo.teras@iki.fi>2021-02-07 23:43:48 +0200
commit361eb063c6bd97751f48e10908e6beaa383ad82f (patch)
treebcc4dc01d47c9a5644a56ba2b74611c8947feb79
parent1a4f2e94ddac3ceb184831105c12fc3b05c0b081 (diff)
downloadapk-tools-361eb063c6bd97751f48e10908e6beaa383ad82f.tar.gz
apk-tools-361eb063c6bd97751f48e10908e6beaa383ad82f.tar.bz2
apk-tools-361eb063c6bd97751f48e10908e6beaa383ad82f.tar.xz
apk-tools-361eb063c6bd97751f48e10908e6beaa383ad82f.zip
db: fix control character check to use uint8_t
fixes #10737
-rw-r--r--src/database.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/database.c b/src/database.c
index 1e506c1..4c32fdc 100644
--- a/src/database.c
+++ b/src/database.c
@@ -2358,8 +2358,8 @@ static const char *format_tmpname(struct apk_package *pkg, struct apk_db_file *f
static int contains_control_character(const char *str)
{
- for (; *str; str++) {
- if (*str < 0x20 || *str == 0x7f) return 1;
+ for (const uint8_t *p = (const uint8_t *) str; *p; p++) {
+ if (*p < 0x20 || *p == 0x7f) return 1;
}
return 0;
}