Skip to content

Commit 634fc77

Browse files
authored
Merge pull request #687 from uyjulian/iomanx_null_terminate_after_strncpy
iomanX null terminate after strncpy in parsefile
2 parents 17306bc + 987eaec commit 634fc77

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

iop/system/iomanx/src/iomanX.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,7 @@ static const char *parsefile(const char *path, iomanX_iop_device_t **p_device, i
10591059
if ( devname_len > (sizeof(canon) - 1) )
10601060
return NULL;
10611061
strncpy(canon, path_trimmed, devname_len);
1062+
canon[devname_len] = 0;
10621063
unit = 0;
10631064
// Search backward for the unit number.
10641065
while ( isnum(canon[devname_len - 1]) )

0 commit comments

Comments
 (0)