if (!fgets(string, 999, stdin))
return NULL;
temp = strchr(string, '\n');
- *temp = '\0';
+ if (temp)
+ *temp = '\0';
return string;
}
*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;
}
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",
if (!fgets(string, 999, stdin))
return NULL;
temp = strchr(string, '\n');
- *temp = '\0';
+ if (temp)
+ *temp = '\0';
return string;
}