checking for null values from config file?
Newb question I know.
How can I ensure values from a config file are not null or a non \0 char? Here is what I have: static int _check_config() { udataptr myUser = &localUser; myConfigPtr myConfig = &localConfig; if( ( myConfig->var1 != '\0' ) && ( myConfig->var2 != '\0' ) && ( myConfig->var3 != '\0' ) && ( myConfig->var4 != '\0' ) && ( myConfig->var5 != '\0' ) ) { return 0; } else { return 1; } } Just assume they are all strings from stdin. Any help is appreciated. |
not one response, strlen()
example; Code:
if( ( strlen( myConfig->var1 ) -1 ) != '\0' ) { |
All times are GMT -5. The time now is 06:08 AM. |