From 49a8434e3707923940236017e5739cdc2c4d2b7a Mon Sep 17 00:00:00 2001 From: Nelson Elhage Date: Sat, 6 Dec 2008 18:52:42 -0500 Subject: [PATCH] Fix three small warnings. --- functions.c | 9 ++++++--- popexec.c | 5 ----- wcwidth.c | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/functions.c b/functions.c index 2a09dc078..815df5cb8 100644 --- a/functions.c +++ b/functions.c @@ -1953,7 +1953,7 @@ void owl_function_delete_automsgs() void owl_function_status() { - char buff[5000]; + char buff[MAXPATHLEN+1]; time_t start; int up, days, hours, minutes; owl_fmtext fm; @@ -1973,8 +1973,11 @@ void owl_function_status() owl_fmtext_append_normal(&fm, "\n"); owl_fmtext_append_normal(&fm, " Current Directory: "); - (void) getcwd(buff, MAXPATHLEN); - owl_fmtext_append_normal(&fm, buff); + if(getcwd(buff, MAXPATHLEN) == NULL) { + owl_fmtext_append_normal(&fm, ""); + } else { + owl_fmtext_append_normal(&fm, buff); + } owl_fmtext_append_normal(&fm, "\n"); sprintf(buff, " Startup Time: %s", ctime(&start)); diff --git a/popexec.c b/popexec.c index 8664383da..382ece2f2 100644 --- a/popexec.c +++ b/popexec.c @@ -72,11 +72,6 @@ owl_popexec *owl_popexec_new(char *command) dup2(child_write_fd, 1 /*stdout*/); dup2(child_write_fd, 2 /*stderr*/); close(child_write_fd); - - while(0) { - write(child_write_fd, "meep\n", 5); - sleep(1); - } argv[0] = "sh"; argv[1] = "-c"; diff --git a/wcwidth.c b/wcwidth.c index 89cbd1c54..1d491c367 100644 --- a/wcwidth.c +++ b/wcwidth.c @@ -61,7 +61,7 @@ #include -static struct interval { +struct interval { /* noproto */ int first; int last; };