aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPreston Pan <135050157+ret2pop@users.noreply.github.com>2024-05-02 20:47:58 -0700
committerGitHub <noreply@github.com>2024-05-02 20:47:58 -0700
commit104437bf7533798087e77b07756cd6b5dcc45bcd (patch)
treed60076e1beee31c81e1f8a604f46b4fa0270d83b /src
parent4738c0ffe90fc5e46a2a31b061b76d49317b6b1e (diff)
parent3f6e346cfb9cce3e24c27c400e345eccc34697d9 (diff)
Merge pull request #9 from EliteTK/fixesHEADmain
A few fixes and improvements
Diffstat (limited to 'src')
-rw-r--r--src/builtins.c4
-rw-r--r--src/main.c2
-rw-r--r--src/stem.c2
3 files changed, 3 insertions, 5 deletions
diff --git a/src/builtins.c b/src/builtins.c
index caf18c2..d6049f3 100644
--- a/src/builtins.c
+++ b/src/builtins.c
@@ -540,7 +540,7 @@ void stemfread(value_t *v) {
eval_error("EMPTY STACK");
return;
}
- char *val = "";
+ char *val = NULL;
size_t len = 0;
FILE *fp = fopen(v1->str_word->value, "rb");
if (!fp) {
@@ -1341,7 +1341,7 @@ void include(value_t *v) {
eval_error("EMPTY STACK");
return;
}
- char *val = "";
+ char *val = NULL;
size_t len = 0;
string_t *strval = init_string("/usr/local/share/stem/stemlib/");
string_concat(strval, v1->str_word);
diff --git a/src/main.c b/src/main.c
index de0abe7..2a6ed6b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -49,7 +49,7 @@ void sigint_handler(int signum) {
int main(int argc, char **argv) {
value_t *v;
size_t len = 0;
- char *buf = "";
+ char *buf = NULL;
/* Parsing arguments */
if (argc < 2) {
diff --git a/src/stem.c b/src/stem.c
index 651d624..f623ae7 100644
--- a/src/stem.c
+++ b/src/stem.c
@@ -331,8 +331,6 @@ value_t *parser_get_next(parser_t *p) {
return parse_quote(p);
case '\0':
return NULL;
- case EOF:
- return NULL;
default:
return parse_word(p);
}