From 41ed9793498916c63d375326ea8c9b3fa1479dd6 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 5 Jan 2013 00:44:24 -0600 Subject: Use basename() where appropriate. --- toys/other/rmmod.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'toys/other/rmmod.c') diff --git a/toys/other/rmmod.c b/toys/other/rmmod.c index 093eb8a1..b789acc6 100644 --- a/toys/other/rmmod.c +++ b/toys/other/rmmod.c @@ -29,9 +29,7 @@ void rmmod_main(void) int len; // Basename - mod_name = strrchr(toys.optargs[0],'/'); - if (mod_name) mod_name++; - else mod_name = toys.optargs[0]; + mod_name = basename(*toys.optargs); // Remove .ko if present len = strlen(mod_name); -- cgit v1.2.3