diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-09-11 16:10:13 +0200 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-09-13 17:36:58 +0200 |
commit | 583568b22fbab0d6d6128433cedf7f1a88c183c1 (patch) | |
tree | 0e84c0ade7e624fae2f6c35c5533c14937b1631d | |
parent | 66deb81240d58400bd73e031357ec3d859892353 (diff) | |
download | unitd-583568b22fbab0d6d6128433cedf7f1a88c183c1.tar unitd-583568b22fbab0d6d6128433cedf7f1a88c183c1.zip |
udevtrigger: remove superfluous strlcpy
Use the "/sys/class/block" string directly
for the stat call. This makes the code simpler
and reduces stack usage.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-rw-r--r-- | udevtrigger.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/udevtrigger.c b/udevtrigger.c index e09ad98..2f1af35 100644 --- a/udevtrigger.c +++ b/udevtrigger.c @@ -295,7 +295,6 @@ static void scan_class(void) int main(int argc, char *argv[], char *envp[]) { - char base[PATH_SIZE]; struct stat statbuf; int option; @@ -331,8 +330,7 @@ int main(int argc, char *argv[], char *envp[]) scan_class(); /* scan "block" if it isn't a "class" */ - strlcpy(base, "/sys/class/block", sizeof(base)); - if (stat(base, &statbuf) != 0) + if (stat("/sys/class/block", &statbuf) != 0) scan_block(); exit: |