From: borutr Date: Mon, 18 Dec 2006 18:05:42 +0000 (+0000) Subject: * src/SDCCutil.c: fixed a bug in (get_pragma_token) X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=a2b40295e70ccdb38ea64a5867ef3decd7543a3e;p=fw%2Fsdcc * src/SDCCutil.c: fixed a bug in (get_pragma_token) * src/pic16/main.c, src/SDCC.lex, src/z80/main.c: small cosmetic changes git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4518 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 33d5321e..3057a89d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-12-18 Borut Razem + + * src/SDCCutil.c: fixed a bug in (get_pragma_token) + * src/pic16/main.c, src/SDCC.lex, src/z80/main.c: + small cosmetic changes + 2006-12-18 Frieder Ferlemann * doc/sdccman.lyx: added the long missed iCode table diff --git a/src/SDCC.lex b/src/SDCC.lex index 23e85bf6..6979cf32 100644 --- a/src/SDCC.lex +++ b/src/SDCC.lex @@ -754,8 +754,7 @@ static int doPragma(int id, const char *name, const char *cp) int warn; cp = get_pragma_token(cp, &token); - - if (token.type != TOKEN_INT) + if (TOKEN_INT != token.type) { err = 1; break; diff --git a/src/SDCCutil.c b/src/SDCCutil.c index d4898f53..34db23da 100644 --- a/src/SDCCutil.c +++ b/src/SDCCutil.c @@ -355,7 +355,7 @@ get_pragma_token(const char *s, struct pragma_token_s *token) long val = strtol(s, &end, 0); - if (end != s && ('\0' == *end || isspace(*s))) + if (end != s && ('\0' == *end || isspace(*end))) { token->val.int_val = val; token->type = TOKEN_INT; diff --git a/src/pic16/main.c b/src/pic16/main.c index 13f3bc47..2a6e0678 100644 --- a/src/pic16/main.c +++ b/src/pic16/main.c @@ -417,7 +417,8 @@ do_pragma(int id, const char *name, const char *cp) * debug link the debug libary * anything else, will link as-is */ - if(!strcmp(lmodule, "c"))libflags.want_libc = 1; + if(!strcmp(lmodule, "c")) + libflags.want_libc = 1; else if(!strcmp(lmodule, "math")) libflags.want_libm = 1; else if(!strcmp(lmodule, "io")) diff --git a/src/z80/main.c b/src/z80/main.c index a5e84064..17451417 100644 --- a/src/z80/main.c +++ b/src/z80/main.c @@ -192,7 +192,7 @@ do_pragma(int id, const char *name, const char *cp) { const char *str = get_pragma_string(&token); - strcpy(buffer, (0 == strcmp("BASE", str)) ? "HOME" : str); + strncpyz(buffer, (0 == strcmp("BASE", str)) ? "HOME" : str, sizeof buffer); } break; }