Skip to content

Commit dc4c2a5

Browse files
author
differrari
committed
[STRING] default to 0x 0b for formatting
1 parent fb9c6b2 commit dc4c2a5

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

kernel/process/syscall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ bool decode_crash_address_with_info(uint8_t depth, uintptr_t address, sizedptr d
254254
if (!debug_line.ptr || !debug_line.size) return false;
255255
debug_line_info info = dwarf_decode_lines(debug_line.ptr, debug_line.size, debug_line_str.ptr, debug_line_str.size, address);
256256
if (info.address == address){
257-
kprintf("%i: %s %i:%i [%x]", depth, info.file, info.line, info.column, address);
257+
kprintf("[%.16x] %i: %s %i:%i", address, depth, info.file, info.line, info.column);
258258
return true;
259259
}
260260
return false;

shared/image/png.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ size_t deflate_uncommpressed(deflate_read_ctx *ctx, size_t max_size) {
146146

147147
len = min(len,max_size);
148148

149-
// printf("Reading %#x bytes from uncompressed deflate block",len);
149+
// printf("Reading %x bytes from uncompressed deflate block",len);
150150

151151
memcpy(ctx->output_buf + ctx->out_cursor, &ctx->bytes[ctx->c], len);
152152
ctx->c += len;
@@ -474,7 +474,7 @@ void png_read_image(void *file, size_t size, uint32_t *buf){
474474
out_buf = (uintptr_t)malloc((info.width * info.height * system_bpp) + info.height);//TODO: bpp might be too big, read image format
475475
ctx.output_buf = (uint8_t*)out_buf;
476476
}
477-
printf("Found some idat %#x - %#x",p + sizeof(png_chunk_hdr) - (uintptr_t)file, length);
477+
printf("Found some idat %x - %x",p + sizeof(png_chunk_hdr) - (uintptr_t)file, length);
478478
deflate_decode((void*)(p + sizeof(png_chunk_hdr)), length, &ctx);
479479
}
480480
p += sizeof(png_chunk_hdr) + __builtin_bswap32(hdr->length) + sizeof(uint32_t);

shared/std/string.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -912,15 +912,15 @@ size_t string_format_va_buf(const char *restrict fmt, char *restrict out, size_t
912912
plen = 2;
913913
}
914914
else switch (spec) {
915-
case 'b': if (flag_hash && outlen > 0) {
915+
case 'b': if (!flag_hash && outlen > 0) {
916916
prefix = "0b";
917917
plen = 2;
918918
} break;
919-
case 'x': if (flag_hash && !(outlen == 0 || (outlen == 1 && obuf[0] == '0'))) {
919+
case 'x': if (!flag_hash && !(outlen == 0 || (outlen == 1 && obuf[0] == '0'))) {
920920
prefix = "0x";
921921
plen = 2;
922922
} break;
923-
case 'X': if (flag_hash && !(outlen == 0 || (outlen == 1 && obuf[0] == '0'))) {
923+
case 'X': if (!flag_hash && !(outlen == 0 || (outlen == 1 && obuf[0] == '0'))) {
924924
prefix = "0X";
925925
plen = 2;
926926
} break;

0 commit comments

Comments
 (0)