← Commit list

b2cca32a3

Bartosz Golaszewski
Bartosz Golaszewski
2015-05-11
SUCCESS Duration: 142s

Subject

i2c-tools: fix 'i2cdetect -l'

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

miscutils/i2c_tools.c+4 -1
@@ -1284,13 +1284,16 @@ int i2cdetect_main(int argc UNUSED_PARAM, char **argv)
unsigned opts;
opt_complementary = "q--r:r--q:" /* mutually exclusive */
- "-1:?3"; /* from 1 to 3 args */
+ "?3"; /* up to 3 args */
opts = getopt32(argv, optstr);
argv += optind;
if (opts & opt_l)
list_i2c_busses_and_exit();
+ if (!argv[0])
+ bb_show_usage();
+
bus_num = i2c_bus_lookup(argv[0]);
fd = i2c_dev_open(bus_num);
get_funcs_matrix(fd, &funcs);