$OpenBSD: patch-src_options_c,v 1.1.1.1 2004/07/01 21:53:16 robert Exp $ --- src/options.c.orig Mon Jun 23 14:09:08 2003 +++ src/options.c Thu Jul 1 23:22:32 2004 @@ -141,6 +141,7 @@ length = strlen(name) + 7; new_title = gib_emalloc(length); + memset(new_title, 0, sizeof(new_title)); dot_pos = strrchr(name, '.'); if (dot_pos) @@ -148,11 +149,11 @@ diff = (dot_pos - name) / sizeof(char); strncpy(new_title, name, diff); - strcat(new_title, "-thumb"); - strcat(new_title, dot_pos); + strlcat(new_title, "-thumb", length); + strlcat(new_title, dot_pos, length); } else - sprintf(new_title, "%s-thumb", name); + snprintf(new_title, length, "%s-thumb", name); return new_title; }