Skip to content

Commit 926b253

Browse files
author
Matthew West
committed
Bug fix - move necessary string print outside version guards
1 parent 9f38244 commit 926b253

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,14 @@ int unload_device_tree(const char *name)
405405
#ifdef BBBVERSION41
406406
char slots[41];
407407
snprintf(ctrl_dir, sizeof(ctrl_dir), "/sys/devices/platform/bone_capemgr");
408-
snprintf(slots, sizeof(slots), "%s/slots", ctrl_dir);
409408
#else
410409
char slots[40];
411410
build_path("/sys/devices", "bone_capemgr", ctrl_dir, sizeof(ctrl_dir));
412411
#endif
413412
char line[256];
414413
char *slot_line;
415414

415+
snprintf(slots, sizeof(slots), "%s/slots", ctrl_dir);
416416
file = fopen(slots, "r+");
417417
if (!file) {
418418
PyErr_SetFromErrnoWithFilename(PyExc_IOError, slots);

0 commit comments

Comments
 (0)