From 82c4588e6311e0168d2bfb6e8922ac6fa7c55199 Mon Sep 17 00:00:00 2001 From: Marcel Alexandru Nitan Date: Sat, 2 Sep 2023 11:48:20 +0300 Subject: [PATCH] Show error when using -cdrom and -rw together --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1df735d..89abc57 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,8 +15,7 @@ int print_help() { printf("-rw\t\t Mounts the file in read write mode.\n"); printf("-cdrom\t\t Mounts the file as a cdrom.\n"); printf("-configfs\t Forces the app to use configfs.\n"); - printf("-usbgadget\t Forces the app to use usb_gadget.\n\n"); - printf("UMOUNT:\n"); + printf("-usbgadget\t Forces the app to use usb_gadget.\n\n"); return 1; } @@ -91,8 +90,9 @@ int main(int argc, char *argv[]) { return 1; } - else { - printf("MOUNT:\n"); + if (strcmp(cdrom, "0") != 0 && strcmp(ro, "1") != 0) { + printf("Incompatible arguments -cdrom and -rw\n"); + return 1; } if (strcmp(configfs, "1") == 0)