summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jones <admin@danieljon.es>2019-04-17 12:42:03 +0930
committerDaniel Jones <admin@danieljon.es>2019-04-17 12:42:03 +0930
commit4a337127c79402bb23909f855e06a47dcad2e606 (patch)
treea58e773758a4ebecc035c9cb314d6ed0d9439d5b
parent667bf7127e0da7160c3eea03151e37590caa1332 (diff)
downloadxwake-4a337127c79402bb23909f855e06a47dcad2e606.tar.gz
xwake-4a337127c79402bb23909f855e06a47dcad2e606.zip
wont destroy start and end time arguemnts now, whoops
-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])
{