diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-11-04 11:28:44 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-11-06 14:19:08 -0800 |
commit | 19137ec2f129f91ce3adb46218c86e1bf547e661 (patch) | |
tree | 237a5a879a738a18009863ecd12464eaff3af544 /ident.c | |
parent | ffd69eb38f153229f5033ef5cc789c0ab3704edd (diff) |
Variable scope reductions as recommended by cppcheck
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'ident.c')
-rw-r--r-- | ident.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -355,11 +355,10 @@ static char * getKeyword(fontFile *f, int *eol) { static char keyword[NKEY + 1]; - int c, i; + int i = 0; - i = 0; while (i < NKEY) { - c = fontFileGetc(f); + int c = fontFileGetc(f); if (c == ' ' || c == '\n') { if (i <= 0) return NULL; @@ -437,7 +436,6 @@ static int bdfIdentify(fontFile *f, char **name) { char *k; - int rc; int eol; /* bitmapIdentify already read "STAR", so we need to check for @@ -449,7 +447,7 @@ bdfIdentify(fontFile *f, char **name) goto fail; while (1) { if (!eol) { - rc = bdfskip(f); + int rc = bdfskip(f); if (rc < 0) goto fail; } |