Mercurial > sdl-ios-xcode
diff src/loadso/macos/SDL_sysloadso.c @ 1379:c0a74f199ecf
Use only safe string functions
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 19 Feb 2006 23:46:34 +0000 |
parents | 19418e4422cb |
children | d910939febfa |
line wrap: on
line diff
--- a/src/loadso/macos/SDL_sysloadso.c Sun Feb 19 23:38:57 2006 +0000 +++ b/src/loadso/macos/SDL_sysloadso.c Sun Feb 19 23:46:34 2006 +0000 @@ -42,8 +42,7 @@ OSErr error; char psofile[512]; - SDL_strncpy(psofile, sofile, SDL_TABLESIZE(psofile)); - psofile[SDL_TABLESIZE(psofile)-1] = '\0'; + SDL_strlcpy(psofile, sofile, SDL_arraysize(psofile)); error = GetSharedLibrary(C2PStr(psofile), kCompiledCFragArch, kLoadCFrag, &library_id, &mainAddr, errName); switch (error) { @@ -80,8 +79,7 @@ CFragConnectionID library_id = (CFragConnectionID)handle; char pname[512]; - SDL_strncpy(pname, name, SDL_TABLESIZE(pname)); - pname[SDL_TABLESIZE(pname)-1] = '\0'; + SDL_strlcpy(pname, name, SDL_arraysize(pname)); if ( FindSymbol(library_id, C2PStr(pname), (char **)&symbol, &class) != noErr ) { loaderror = "Symbol not found";