commit 15d2657f2920dd3f865dc4177a7525ec56ab5550
parent 97e9707df83458d688fa7d605a79c6687ce49d65
Author: Friedel Schön <[email protected]>
Date: Tue, 23 May 2023 09:34:41 +0200
nullify disk/state if option does not use it
Diffstat:
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/exec/zzz.c b/src/exec/zzz.c
@@ -32,12 +32,19 @@ int main(int argc, char** argv) {
switch (opt) {
case 'n':
new_state = NULL;
+ new_disk = NULL;
+ break;
+ case 's':
+ new_state = "suspend";
+ new_disk = NULL;
break;
case 'S':
new_state = "freeze";
+ new_disk = NULL;
break;
case 'z':
new_state = "mem";
+ new_disk = NULL;
break;
case 'Z':
new_state = "disk";
@@ -51,9 +58,6 @@ int main(int argc, char** argv) {
new_state = "disk";
new_disk = "suspend";
break;
- case 's':
- new_state = "suspend";
- break;
default:
printf("zzz [-n] [-S] [-z] [-Z] [-R] [-H]\n");
return 1;