Skip to content

Commit 90d4a1d

Browse files
committed
Add a 3 arguments overload of strncpy_s
1 parent 9770522 commit 90d4a1d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Common/PlatformLinux.inl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,12 @@ typedef dirent DirEntryType;
267267
#define lstrcpy strcpy
268268
#define stricmp strcasecmp
269269
#define strupr SDL_strupr
270-
#define strncpy_s(dest, size, source, num) (NULL == strncpy(dest, source, num))
270+
inline bool strncpy_s(char * dest, size_t, const char * source, size_t num) {
271+
return NULL == strncpy(dest, source, num);
272+
}
273+
inline bool strncpy_s(char * dest, const char * source, size_t num) {
274+
return NULL == strncpy(dest, source, num);
275+
}
271276
#define strcpy_s(dest, num, source) (NULL == strcpy(dest, source))
272277
#define strcat_s(dest, num, source) (dest == strcat(dest, source))
273278
#define _vsnprintf vsnprintf

0 commit comments

Comments
 (0)