Squash more warns

This commit is contained in:
Sergey Lyubka committed 2022-07-04 11:43:52 +01:00
1 parent 4c9fdaf8b0
commit 735b7bece6
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -5412,7 +5412,7 @@ char *mg_random_str(char *buf, size_t len) {
mg_random(buf, len);
for (i = 0; i < len; i++) {
uint8_t c = ((uint8_t *) buf)[i] % 62;
buf[i] = i == len - 1 ? '\0' // 0-terminate last byte
buf[i] = i == len - 1 ? (char) '\0' // 0-terminate last byte
: c < 26 ? (char) ('a' + c) // lowercase
: c < 52 ? (char) ('A' + c - 26) // uppercase
: (char) ('0' + c - 52); // numeric
+1 -1
View File
@@ -26,7 +26,7 @@ char *mg_random_str(char *buf, size_t len) {
mg_random(buf, len);
for (i = 0; i < len; i++) {
uint8_t c = ((uint8_t *) buf)[i] % 62;
buf[i] = i == len - 1 ? '\0' // 0-terminate last byte
buf[i] = i == len - 1 ? (char) '\0' // 0-terminate last byte
: c < 26 ? (char) ('a' + c) // lowercase
: c < 52 ? (char) ('A' + c - 26) // uppercase
: (char) ('0' + c - 52); // numeric