diff options
author | Daniel Jones <admin@danieljon.es> | 2019-04-17 12:42:03 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2019-04-17 12:42:03 +0930 |
commit | 4a337127c79402bb23909f855e06a47dcad2e606 (patch) | |
tree | a58e773758a4ebecc035c9cb314d6ed0d9439d5b | |
parent | 667bf7127e0da7160c3eea03151e37590caa1332 (diff) | |
download | xwake-4a337127c79402bb23909f855e06a47dcad2e606.tar.gz xwake-4a337127c79402bb23909f855e06a47dcad2e606.zip |
wont destroy start and end time arguemnts now, whoops
-rw-r--r-- | xwake.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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]) { |