[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Confuse-devel] [PATCH 5/5] confuse: match sign for parsed octal and hex
From: |
Carlo Marcelo Arenas Belon |
Subject: |
[Confuse-devel] [PATCH 5/5] confuse: match sign for parsed octal and hexadecimal input |
Date: |
Sun, 30 Nov 2008 13:55:58 -0800 |
as shown by the following warning :
lexer.l: In function ‘cfg_yylex’:
lexer.l:142: warning: format ‘%o’ expects type ‘unsigned int *’, but argument
3 has type ‘int *’
lexer.l:155: warning: format ‘%x’ expects type ‘unsigned int *’, but argument
3 has type ‘int *’
Signed-off-by: Carlo Marcelo Arenas Belon <address@hidden>
---
src/lexer.l | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lexer.l b/src/lexer.l
index aff7f6f..1e0fa91 100644
--- a/src/lexer.l
+++ b/src/lexer.l
@@ -138,7 +138,7 @@ static YY_BUFFER_STATE string_scan_state = 0;
cfg->line++;
}
<dq_str>\\[0-7]{1,3} { /* octal escape sequence */
- int result;
+ unsigned int result;
sscanf(yytext + 1, "%o", &result);
if(result > 0xFF) {
cfg_error(cfg, _("invalid octal number '%s'"), yytext);
@@ -151,7 +151,7 @@ static YY_BUFFER_STATE string_scan_state = 0;
return 0;
}
<dq_str>"\\x"[0-9A-Fa-f]{1,2} { /* hexadecimal escape sequence */
- int result;
+ unsigned int result;
sscanf(yytext + 2, "%x", &result);
qputc(result);
}