Skip to content

Commit d5f7328

Browse files
committed
Skip strncpy
Signed-off-by: Filipe Laíns <lains@riseup.net
1 parent e6e1325 commit d5f7328

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Modules/getpath.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -818,13 +818,9 @@ library_to_dict(PyObject *dict, const char *key)
818818
#endif
819819

820820
#if HAVE_DLADDR
821-
char path[MAXPATHLEN + 1];
822821
Dl_info libpython_info;
823822
if (dladdr(&Py_Initialize, &libpython_info) && libpython_info.dli_fname) {
824-
strncpy(path, libpython_info.dli_fname, MAXPATHLEN);
825-
if (path[sizeof(path)-1] == '\0') {
826-
return decode_to_dict(dict, key, path);
827-
}
823+
return decode_to_dict(dict, key, libpython_info.dli_fname);
828824
}
829825
#endif
830826
#endif

0 commit comments

Comments
 (0)