mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 02:26:11 +00:00
printf: Support %zu (the 'z' is really just ignored.)
This commit is contained in:
parent
1b6fa30e58
commit
3ed17b0792
|
@ -200,6 +200,8 @@ template<typename PutChFunc>
|
|||
bool zeroPad = false;
|
||||
unsigned fieldWidth = 0;
|
||||
unsigned long_qualifiers = 0;
|
||||
bool size_qualifier = false;
|
||||
(void)size_qualifier;
|
||||
bool alternate_form = 0;
|
||||
if (*p == '%' && *(p + 1)) {
|
||||
one_more:
|
||||
|
@ -225,6 +227,11 @@ template<typename PutChFunc>
|
|||
if (*(p + 1))
|
||||
goto one_more;
|
||||
}
|
||||
if (*p == 'z') {
|
||||
size_qualifier = true;
|
||||
if (*(p + 1))
|
||||
goto one_more;
|
||||
}
|
||||
if (*p == '#') {
|
||||
alternate_form = true;
|
||||
if (*(p + 1))
|
||||
|
|
|
@ -168,7 +168,7 @@ void* malloc(size_t size)
|
|||
|
||||
if (!block) {
|
||||
char buffer[64];
|
||||
snprintf(buffer, sizeof(buffer), "malloc: ChunkedBlock(%u)", good_size);
|
||||
snprintf(buffer, sizeof(buffer), "malloc: ChunkedBlock(%zu)", good_size);
|
||||
block = (ChunkedBlock*)os_alloc(PAGE_SIZE, buffer);
|
||||
new (block) ChunkedBlock(good_size);
|
||||
allocator->usable_blocks.append(block);
|
||||
|
|
|
@ -80,7 +80,7 @@ int main(int argc, char** argv)
|
|||
printf("\033[36;1m%s\033[0m", buffer);
|
||||
}
|
||||
|
||||
printf("(%u bytes received)\n", total_recv);
|
||||
printf("(%zu bytes received)\n", total_recv);
|
||||
rc = close(fd);
|
||||
if (rc < 0) {
|
||||
perror("close");
|
||||
|
|
Loading…
Reference in a new issue