src/mod-helpserv.c (create_request): Use explicit format strings for
sprintf() when no format argument is passed.
src/modcmd.c: Store the result of strtoul() into a variable.
src/nickserv.c: Pay attention to the return value of fgets().
sprintf(lbuf[1], fmt, unh);
} else {
fmt = user_find_message(user, "HSMSG_REQ_NO_UNHANDLED");
sprintf(lbuf[1], fmt, unh);
} else {
fmt = user_find_message(user, "HSMSG_REQ_NO_UNHANDLED");
+ sprintf(lbuf[1], "%s", fmt);
}
switch (hs->persist_types[PERSIST_T_REQUEST]) {
case PERSIST_PART:
}
switch (hs->persist_types[PERSIST_T_REQUEST]) {
case PERSIST_PART:
break;
case PERSIST_QUIT:
fmt = user_find_message(user, "HSMSG_REQ_PERSIST_QUIT");
break;
case PERSIST_QUIT:
fmt = user_find_message(user, "HSMSG_REQ_PERSIST_QUIT");
+ sprintf(lbuf[2], "%s", fmt);
break;
default:
log_module(HS_LOG, LOG_ERROR, "%s has an invalid req_persist.", hs->helpserv->nick);
case PERSIST_CLOSE:
if (user->handle_info) {
fmt = user_find_message(user, "HSMSG_REQ_PERSIST_HANDLE");
break;
default:
log_module(HS_LOG, LOG_ERROR, "%s has an invalid req_persist.", hs->helpserv->nick);
case PERSIST_CLOSE:
if (user->handle_info) {
fmt = user_find_message(user, "HSMSG_REQ_PERSIST_HANDLE");
} else {
fmt = user_find_message(user, "HSMSG_REQ_PERSIST_QUIT");
} else {
fmt = user_find_message(user, "HSMSG_REQ_PERSIST_QUIT");
+ sprintf(lbuf[2], "%s", fmt);
break;
}
helpserv_message(hs, user, MSGTYPE_REQ_OPENED);
break;
}
helpserv_message(hs, user, MSGTYPE_REQ_OPENED);
continue;
} else if (isdigit(argv[arg][1])) {
char *end_num;
continue;
} else if (isdigit(argv[arg][1])) {
char *end_num;
- strtoul(argv[arg]+1, &end_num, 10);
+ arg = strtoul(argv[arg]+1, &end_num, 10);
switch (end_num[0]) {
case 0:
continue;
switch (end_num[0]) {
case 0:
continue;
log_module(NS_LOG, LOG_ERROR, "Unable to open dictionary file %s: %s", fname, strerror(errno));
return;
}
log_module(NS_LOG, LOG_ERROR, "Unable to open dictionary file %s: %s", fname, strerror(errno));
return;
}
- while (!feof(file)) {
- fgets(line, sizeof(line), file);
+ while (fgets(line, sizeof(line), file)) {
if (!line[0])
continue;
if (line[strlen(line)-1] == '\n')
if (!line[0])
continue;
if (line[strlen(line)-1] == '\n')