summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xwake.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/xwake.c b/xwake.c
index 0701db6..6ad6775 100644
--- a/xwake.c
+++ b/xwake.c
@@ -41,10 +41,14 @@ gettime(int *store)
void
gettriggertimes(int *startarr, int *endarr)
{
- startarr[0] = atoi(strtok(start, ":"));
+ char smodify[6];
+ char emodify[6];
+ strncpy(smodify, start, 5);
+ strncpy(emodify, end, 5);
+ startarr[0] = atoi(strtok(smodify, ":"));
startarr[1] = atoi(strtok(NULL, ":"));
- endarr[0] = atoi(strtok(end, ":"));
+ endarr[0] = atoi(strtok(emodify, ":"));
endarr[1] = atoi(strtok(NULL, ":"));
}
@@ -67,7 +71,6 @@ main(int argc, char *argv[])
{
if (strcmp(argv[1], "reset") == 0)
{
- puts("enabling screensaver and exiting");
XScreenSaverSuspend(dsp, False);
XFlush(dsp);
XCloseDisplay(dsp);
@@ -87,6 +90,7 @@ main(int argc, char *argv[])
XScreenSaverSuspend(dsp, True);
XFlush(dsp);
setwontsleep = 1;
+ puts("wont sleep");
}
else if (setwontsleep == 1 && endarr[0] == time[0] && endarr[1] == time[1])
{