projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d9d58ea
)
cppcheck cleanup.
author
Eric S. Raymond
<esr@thyrsus.com>
Mon, 18 Apr 2022 14:24:11 +0000
(10:24 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Mon, 18 Apr 2022 14:24:11 +0000
(10:24 -0400)
Makefile
patch
|
blob
|
history
main.c
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index 84039b4e8df8a5a698fd77cb30a5d19f4ae66d76..92e97da6fff4ed32e38abb4b0c62c7b128dff679 100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-136,7
+136,7
@@
debug: CCFLAGS += -fsanitize=address
debug: CCFLAGS += -fsanitize=undefined
debug: linty
debug: CCFLAGS += -fsanitize=undefined
debug: linty
-
PY
SUPPRESSIONS = --suppress=missingIncludeSystem --suppress=invalidscanf
+
C
SUPPRESSIONS = --suppress=missingIncludeSystem --suppress=invalidscanf
cppcheck:
cppcheck -I. --template gcc --enable=all $(CSUPPRESSIONS) *.[ch]
cppcheck:
cppcheck -I. --template gcc --enable=all $(CSUPPRESSIONS) *.[ch]
diff --git
a/main.c
b/main.c
index 0bc737b3dea7f38c59aade10379a8b24f2750968..514ae598c97e3f01f898076395c9e92754cb079a 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-147,7
+147,7
@@
char *myreadline(const char *prompt)
if (settings.argc == 0)
return readline(prompt);
if (settings.argc == 0)
return readline(prompt);
- char *buf = malloc(
BUFSIZ
);
+ char *buf = malloc(
LINESIZE+1
);
for (;;) {
if (settings.scriptfp == NULL || feof(settings.scriptfp)) {
if (settings.optind >= settings.argc) {
for (;;) {
if (settings.scriptfp == NULL || feof(settings.scriptfp)) {
if (settings.optind >= settings.argc) {
@@
-169,7
+169,7
@@
char *myreadline(const char *prompt)
free(buf); // LCOV_EXCL_LINE
return readline(prompt); // LCOV_EXCL_LINE
} else {
free(buf); // LCOV_EXCL_LINE
return readline(prompt); // LCOV_EXCL_LINE
} else {
- char *ln = fgets(buf,
BUFSIZ-1
, settings.scriptfp);
+ char *ln = fgets(buf,
LINESIZE
, settings.scriptfp);
if (ln != NULL) {
fputs(PROMPT, stdout);
fputs(ln, stdout);
if (ln != NULL) {
fputs(PROMPT, stdout);
fputs(ln, stdout);