projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
51b6b52
)
Don't zero stuff twice
author
NHOrus
<jy6x2b32pie9@yahoo.com>
Fri, 7 Jul 2017 08:18:02 +0000
(11:18 +0300)
committer
NHOrus
<jy6x2b32pie9@yahoo.com>
Fri, 7 Jul 2017 08:18:02 +0000
(11:18 +0300)
main.c
patch
|
blob
|
history
misc.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index 5f7cd3fe2788d49ac449491d68ddc2ddad590acf..b788c618e65428352c0a5f9be4a619ecb194baaa 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-1014,9
+1014,7
@@
static bool do_command()
listobjects();
L2012:
listobjects();
L2012:
- command.verb = 0;
game.oldobj = command.obj;
game.oldobj = command.obj;
- command.obj = 0;
L2600:
checkhints();
L2600:
checkhints();
@@
-1047,6
+1045,7
@@
L2600:
return (false);
if (word_count(input) > 2) {
rspeak(TWO_WORDS);
return (false);
if (word_count(input) > 2) {
rspeak(TWO_WORDS);
+ free(input);
continue;
}
if (strcmp(input, "") != 0)
continue;
}
if (strcmp(input, "") != 0)
diff --git
a/misc.c
b/misc.c
index 0c2a5439edf9aec4ab7492d0a83526e3326e3072..784eb7310f063ee3a700055a17590e4d83a13786 100644
(file)
--- a/
misc.c
+++ b/
misc.c
@@
-328,11
+328,12
@@
char* get_input()
if (input == NULL) // Got EOF; return with it.
return (input);
if (input == NULL) // Got EOF; return with it.
return (input);
-
else
if (input[0] == '#') { // Ignore comments.
+ if (input[0] == '#') { // Ignore comments.
free(input);
continue;
free(input);
continue;
- } else // We have a 'normal' line; leave the loop.
- break;
+ }
+ // We have a 'normal' line; leave the loop.
+ break;
}
// Strip trailing newlines from the input
}
// Strip trailing newlines from the input