} else {
strncpy(buf, icon, sizeof(buf));
+ buf[sizeof(buf)-1] = '\0';
}
return buf;
char str[32];
memset(&tm, 0, sizeof(tm));
- strcpy(str, in);
+ strncpy(str, in, sizeof(str));
+ str[sizeof(str)-1] = '\0';
/* split tz */
while (str[sp] && str[sp] != ' ')
int r;
struct thread_state *ts = calloc(1, sizeof(struct thread_state));
strncpy(ts->name, name, sizeof(ts->name));
+ ts->name[sizeof(ts->name)-1] = '\0';
ts->run = start_routine;
ts->arg = arg;
r = pthread_create(thread, attr, thread_wrapper, ts);