From 1e116c9679506a2e69ca4e7fad4c8ca655f2f784 Mon Sep 17 00:00:00 2001 From: turbocat Date: Tue, 26 Jul 2022 08:32:48 +0000 Subject: [PATCH] libc.obj : Try fix "%o" scanf bug. git-svn-id: svn://kolibrios.org@9862 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../trunk/libc.obj/source/stdio/format_scan.c | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/programs/develop/ktcc/trunk/libc.obj/source/stdio/format_scan.c b/programs/develop/ktcc/trunk/libc.obj/source/stdio/format_scan.c index 202e3737f9..80aff10bcc 100644 --- a/programs/develop/ktcc/trunk/libc.obj/source/stdio/format_scan.c +++ b/programs/develop/ktcc/trunk/libc.obj/source/stdio/format_scan.c @@ -24,17 +24,17 @@ typedef void (*virtual_ungetc)(void *sp, int c, const void *obj); enum flags_t { - flag_unsigned = 0x02, - flag_register = 0x04, - flag_plus = 0x08, - flag_left_just = 0x10, - flag_lead_zeros = 0x20, - flag_space_plus = 0x40, - flag_hash_sign = 0x80, - flag_point = 0x100 + flag_unsigned = 0x02, + flag_register = 0x04, + flag_plus = 0x08, + flag_left_just = 0x10, + flag_lead_zeros = 0x20, + flag_space_plus = 0x40, + flag_hash_sign = 0x80, + flag_point = 0x100 }; -int try_parse_real(long double *real, int ch, const void *src, void *save, virtual_getc vgetc, virtual_ungetc vungetc) +int try_parse_real(long double *real, int ch, const void *src, void *save, virtual_getc vgetc, virtual_ungetc vungetc) // returns 1 if OK, -1 == EOF, -2 parse broken { int sign = 1, have_digits = 0; @@ -153,7 +153,7 @@ int try_parse_real(long double *real, int ch, const void *src, void *save, v return 1; } -int try_parse_int(long long *digit, int ch, const void *src, void *save, virtual_getc vgetc, virtual_ungetc vungetc) +int try_parse_int(long long *digit, int ch, const void *src, void *save, virtual_getc vgetc, virtual_ungetc vungetc) { int sign = 1, base = 10, have_digits = 0; @@ -172,7 +172,7 @@ int try_parse_int(long long *digit, int ch, const void *src, void *save, vir if (ch == '0') // octal or hex, read next { ch = vgetc(save, src); - if (ch == 'c' || ch == 'C') + if (ch == 'o') base = 8; else if (ch == 'x' || ch == 'X') base = 16;