projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cppcheck cleanup.
[open-adventure.git]
/
main.c
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);