mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-18 23:53:15 +08:00
Squash more warns
This commit is contained in:
parent
4c9fdaf8b0
commit
735b7bece6
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user