openbsd-ports/misc/wmtimer/patches/patch-wmtimer_wmtimer_c

31 lines
1.0 KiB
Plaintext
Raw Normal View History

$OpenBSD: patch-wmtimer_wmtimer_c,v 1.2 2001/10/26 22:54:36 wilfried Exp $
--- wmtimer/wmtimer.c.orig Fri Oct 12 02:29:21 2001
+++ wmtimer/wmtimer.c Sat Oct 27 00:38:53 2001
@@ -83,7 +83,7 @@ configState configSt;
int main(int argc, char *argv[])
{
int prevSec = 0;
- long now;
+ time_t now;
struct tm *thisTime;
int wminet_mask_width = 64;
int wminet_mask_height = 64;
@@ -221,7 +221,7 @@ void parseArgs(int argc, char *argv[])
mode = CHRONO_ACTIVE;
break;
case 'e':
- strcpy(command, argv[argIndex+1]);
+ strlcpy(command, argv[argIndex+1], sizeof(command));
action = COMMAND;
break;
case 't':
@@ -552,7 +552,7 @@ void callback(GtkWidget * widget, gpoint
else if ((char *) data == "ok")
{
if (tmpAction == COMMAND)
- strcpy(command, gtk_entry_get_text(GTK_ENTRY (entry)));
+ strlcpy(command, gtk_entry_get_text(GTK_ENTRY (entry)), sizeof(command));
hour = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON (spinner1));
min = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON (spinner2));