mirror of https://github.com/encounter/SDL.git
use != '\0' comparison instead of SDL_strlen in the functions of SDL_getenv
This commit is contained in:
parent
b944dc8f2e
commit
b59ca92e82
|
@ -48,7 +48,7 @@ int
|
||||||
SDL_setenv(const char *name, const char *value, int overwrite)
|
SDL_setenv(const char *name, const char *value, int overwrite)
|
||||||
{
|
{
|
||||||
/* Input validation */
|
/* Input validation */
|
||||||
if (!name || SDL_strlen(name) == 0 || SDL_strchr(name, '=') != NULL || !value) {
|
if (!name || *name == '\0' || SDL_strchr(name, '=') != NULL || !value) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ int
|
||||||
SDL_setenv(const char *name, const char *value, int overwrite)
|
SDL_setenv(const char *name, const char *value, int overwrite)
|
||||||
{
|
{
|
||||||
/* Input validation */
|
/* Input validation */
|
||||||
if (!name || SDL_strlen(name) == 0 || SDL_strchr(name, '=') != NULL || !value) {
|
if (!name || *name == '\0' || SDL_strchr(name, '=') != NULL || !value) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ SDL_setenv(const char *name, const char *value, int overwrite)
|
||||||
char *new_variable;
|
char *new_variable;
|
||||||
|
|
||||||
/* Input validation */
|
/* Input validation */
|
||||||
if (!name || SDL_strlen(name) == 0 || SDL_strchr(name, '=') != NULL || !value) {
|
if (!name || *name == '\0' || SDL_strchr(name, '=') != NULL || !value) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ SDL_setenv(const char *name, const char *value, int overwrite)
|
||||||
char *new_variable;
|
char *new_variable;
|
||||||
|
|
||||||
/* Input validation */
|
/* Input validation */
|
||||||
if (!name || SDL_strlen(name) == 0 || SDL_strchr(name, '=') != NULL || !value) {
|
if (!name || *name == '\0' || SDL_strchr(name, '=') != NULL || !value) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ SDL_getenv(const char *name)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Input validation */
|
/* Input validation */
|
||||||
if (!name || !*name) {
|
if (!name || *name == '\0') {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ SDL_getenv(const char *name)
|
||||||
size_t bufferlen;
|
size_t bufferlen;
|
||||||
|
|
||||||
/* Input validation */
|
/* Input validation */
|
||||||
if (!name || SDL_strlen(name)==0) {
|
if (!name || *name == '\0') {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ SDL_getenv(const char *name)
|
||||||
char *value;
|
char *value;
|
||||||
|
|
||||||
/* Input validation */
|
/* Input validation */
|
||||||
if (!name || SDL_strlen(name)==0) {
|
if (!name || *name == '\0') {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue