]> ToastFreeware Gitweb - gregoa/bti.git/blobdiff - bti.c
Typo fixes for bti(1)
[gregoa/bti.git] / bti.c
diff --git a/bti.c b/bti.c
index 02b8aea5c0d8b231871ede345e68384b301f044f..0668ccd1c929c9d8646212173760e9c4d5e3cec2 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -144,7 +144,8 @@ static char *get_string(const char *name)
        if (!fgets(string, 999, stdin))
                return NULL;
        temp = strchr(string, '\n');
-       *temp = '\0';
+       if (temp)
+               *temp = '\0';
        return string;
 }
 
@@ -189,7 +190,8 @@ static void session_readline_init(struct session *session)
                        *next++ = 0;
                if (*cp == 0)
                        continue;
-               if ((handle = dlopen(cp, RTLD_NOW))) {
+               handle = dlopen(cp, RTLD_NOW);
+               if (handle) {
                        dbg("Using %s for readline library\n", cp);
                        break;
                }
@@ -708,7 +710,8 @@ static void log_session(struct session *session, int retval)
                                session->time, session->hostname);
                else
                        fprintf(log_file, "%s: host=%s tweet=%s\n",
-                               session->time, session->hostname, session->tweet);
+                               session->time, session->hostname,
+                               session->tweet);
                break;
        case ACTION_FRIENDS:
                fprintf(log_file, "%s: host=%s retrieving friends timeline\n",
@@ -749,7 +752,8 @@ static char *get_string_from_stdin(void)
        if (!fgets(string, 999, stdin))
                return NULL;
        temp = strchr(string, '\n');
-       *temp = '\0';
+       if (temp)
+               *temp = '\0';
        return string;
 }