From e7a813d8345f21a238ec803c207e2cfb41969106 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 4 Nov 2023 22:19:51 +0300 Subject: [PATCH] fixed --- README.md | 14 +++++++------- TODO | 5 ----- coreutils/shred.c | 10 ++-------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index f8ae339..a92161c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # micro-utils -[Compile] - cc builder.c -obuilder - ./buulder +[Compile] + cc builder.c -obuilder + ./builder - [or] - sh build.sh +[or] + sh build.sh -[Config] - edit config.h +[Config] + edit config.h diff --git a/TODO b/TODO index ea8f582..232d09d 100644 --- a/TODO +++ b/TODO @@ -53,11 +53,6 @@ Loginutils: delgroup getty -Console-tools: - loadkmap - openvt - chvt - Miscutils: time diff --git a/coreutils/shred.c b/coreutils/shred.c index a5054c4..07f2699 100644 --- a/coreutils/shred.c +++ b/coreutils/shred.c @@ -59,14 +59,8 @@ int main(const int argc, const char **argv) { else if (!strcmp(argv[i], "-z")) z_flag = 1; - else if (!strncmp(argv[i], "-n=", 3)) { - char *val = strchr(argv[i], '='); - if (!val) - break; - - val[0] = '\0'; - n_loops = atoi(val + 1); - } + else if (!strncmp(argv[i], "-n=", 3) + n_loops = atoi(argv[i] + 3); else if (!strcmp(argv[i], "--help")) { printf("shred [-n=N Overwrite N times (default 3)] [-z Final overwrite with zeros] [-u Remove file] [-f Chmod to ensure writability] [file file2...]\n");