* src/SDCCutil.c: fixed a bug in (get_pragma_token)
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 18 Dec 2006 18:05:42 +0000 (18:05 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 18 Dec 2006 18:05:42 +0000 (18:05 +0000)
* 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

ChangeLog
src/SDCC.lex
src/SDCCutil.c
src/pic16/main.c
src/z80/main.c

index 33d5321e5dca65c39eefb40abe90e25ffbaaad17..3057a89d56d5657fdaa7d5a3354f8de3d950ee5a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-12-18 Borut Razem <borut.razem AT siol.net>
+
+       * 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 <Frieder.Ferlemann AT web.de>
 
        * doc/sdccman.lyx: added the long missed iCode table 
index 23e85bf6f76eff34ba05f399e965caa81dbd7727..6979cf32df24dd6a70b56c44fa0bacbcf895f1a4 100644 (file)
@@ -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;
index d4898f530e8025868af07e5cdb579b9f91412b76..34db23dab44fcadfeddf2bf9d944c1555484fd62 100644 (file)
@@ -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;
index 13f3bc47d2fe38050019a543ad4984f59885ca3c..2a6e06784e1faffa6a125a2342dd8a432612e110 100644 (file)
@@ -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"))
index a5e840647a88fbfc47b797fe5d6486c4b0a54ae6..17451417a6272194d4b4f740044a0c9e1dc70157 100644 (file)
@@ -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;
           }