- Timestamp:
- 2008-08-24T18:01:05Z (16 years ago)
- Branches:
- master
- Children:
- f3579fd
- Parents:
- 934dddf3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
account.c
r934dddf3 r7125cb3 77 77 /* Double-check: We refuse to edit on-line accounts. */ 78 78 if( set->flags & ACC_SET_OFFLINE_ONLY && acc->ic ) 79 return NULL;79 return SET_INVALID; 80 80 81 81 if( strcmp( set->key, "server" ) == 0 ) … … 89 89 else 90 90 { 91 acc->server = NULL;91 acc->server = g_strdup( set->def ); 92 92 return g_strdup( set->def ); 93 93 } 94 }95 else if( value == NULL )96 {97 /* Noop, the other three can't be NULL. */98 94 } 99 95 else if( strcmp( set->key, "username" ) == 0 ) … … 105 101 else if( strcmp( set->key, "password" ) == 0 ) 106 102 { 107 g_free( acc->pass ); 108 acc->pass = g_strdup( value ); 109 return NULL; /* password shouldn't be visible in plaintext! */ 103 if( value ) 104 { 105 g_free( acc->pass ); 106 acc->pass = g_strdup( value ); 107 return NULL; /* password shouldn't be visible in plaintext! */ 108 } 109 else 110 { 111 /* NULL can (should) be stored in the set_t 112 variable, but is otherwise not correct. */ 113 return SET_INVALID; 114 } 110 115 } 111 116 else if( strcmp( set->key, "auto_connect" ) == 0 ) 112 117 { 113 118 if( !is_bool( value ) ) 114 return NULL;119 return SET_INVALID; 115 120 116 121 acc->auto_connect = bool2int( value ); … … 118 123 } 119 124 120 return NULL;125 return SET_INVALID; 121 126 } 122 127 … … 258 263 259 264 /* Sure, call me evil for implementing my own fscanf here, but it's 260 dead simple and I 'm immediately at the next part to parse. */265 dead simple and I immediately know where to continue parsing. */ 261 266 262 267 if( *value == 0 ) … … 291 296 struct account_reconnect_delay p; 292 297 293 return account_reconnect_delay_parse( value, &p ) ? value : NULL;298 return account_reconnect_delay_parse( value, &p ) ? value : SET_INVALID; 294 299 } 295 300
Note: See TracChangeset
for help on using the changeset viewer.