beaglebone.c: use snprintf instead of sprintf in i2c_init_pre
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
808d314043
commit
8f57b21a26
@@ -264,7 +264,7 @@ mraa_beaglebone_i2c_init_pre(unsigned int bus)
|
||||
mraa_result_t ret = MRAA_ERROR_NO_RESOURCES;
|
||||
char devpath[MAX_SIZE];
|
||||
|
||||
sprintf(devpath, "/dev/i2c-%u", bus);
|
||||
snprintf(devpath, MAX_SIZE, "/dev/i2c-%u", bus);
|
||||
|
||||
if (!mraa_file_exist(devpath)) {
|
||||
ret = MRAA_ERROR_INVALID_HANDLE;
|
||||
|
||||
Reference in New Issue
Block a user