diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-03 23:40:28 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-03 23:40:28 +0000 |
| commit | 489f632caba55960978eee64502a02ea7961f944 (patch) | |
| tree | 3d59b37da376a19f6aa4d816d3776002cf803087 /util/nvmutil/nvmutil.c | |
| parent | 76d6900d696e9ea73f0473fb8298f313422b184f (diff) | |
util/nvmutil: simpler mac address totalling
i know it's always going to be 3
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 349bcd8c..1b8c04e3 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -13,7 +13,7 @@ #include <string.h> #include <unistd.h> -static void reset_global_state(int, char **); +static void reset_global_state(void); static void set_cmd(int, char **); static void check_cmd_args(int, char **); static void set_io_flags(int, char **); @@ -102,7 +102,8 @@ main(int argc, char *argv[]) argv0 = argv[0]; if (argc < 2) usage(); - reset_global_state(argc, argv); + fname = argv[1]; + reset_global_state(); #ifdef __OpenBSD__ err_if(pledge("stdio rpath wpath unveil", NULL) == -1); err_if(unveil("/dev/urandom", "r") == -1); @@ -139,7 +140,7 @@ main(int argc, char *argv[]) } static void -reset_global_state(int argc, char *argv[]) +reset_global_state(void) { mac = NULL; invert = 0; @@ -147,8 +148,6 @@ reset_global_state(int argc, char *argv[]) part_modified[1] = 0; fname = ""; cmd = NULL; - - fname = argv[1]; } static void @@ -306,7 +305,7 @@ parse_mac_string(void) set_mac_byte(mac_pos); mac_total = 0; - for (c = 0; c < sizeof(macbuf); c++) + for (c = 0; c < 3; c++) mac_total += macbuf[c]; if (mac_total == 0) |
