summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-15 11:12:10 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-15 11:12:10 -0800
commit591e62a56ba2ab90ad159ae89406b9790bd96a11 (patch)
tree56c95583ef8111e3ffef302268ec94527c50c217
parent95c3038f4a7e03c28ec6b209ec111cb2e3444646 (diff)
GetLine: resolve -Wmaybe-uninitialized warning
lex.c: In function ‘GetLine’: lex.c:38:8: warning: ‘c’ may be used uninitialized [-Wmaybe-uninitialized] 38 | if (c == '\n') | ^ lex.c:29:16: note: ‘c’ was declared here 29 | int i = 0, c; | ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--lex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lex.c b/lex.c
index 9f11a15..d39c9eb 100644
--- a/lex.c
+++ b/lex.c
@@ -26,7 +26,7 @@ DviGetAndPut(DviWidget dw, int *cp)
char *
GetLine(DviWidget dw, char *Buffer, int Length)
{
- int i = 0, c;
+ int i = 0, c = 0;
char *p = Buffer;
Length--; /* Save room for final NULL */