Commit 89498ecf5e04c2a4af39b8ae5714ecca7a569caa
1 parent
1f2d57d7
Exists in
master
and in
3 other branches
Reorganizando montagem das acoes para uso de novos atributos
Showing
1 changed file
with
7 additions
and
6 deletions
Show diff stats
toggles.c
@@ -222,14 +222,15 @@ LIB3270_EXPORT const char * lib3270_get_toggle_name(LIB3270_TOGGLE_ID ix) | @@ -222,14 +222,15 @@ LIB3270_EXPORT const char * lib3270_get_toggle_name(LIB3270_TOGGLE_ID ix) | ||
222 | 222 | ||
223 | LIB3270_EXPORT LIB3270_TOGGLE lib3270_get_toggle_id(const char *name) | 223 | LIB3270_EXPORT LIB3270_TOGGLE lib3270_get_toggle_id(const char *name) |
224 | { | 224 | { |
225 | - int f; | ||
226 | - | ||
227 | - for(f=0;f<N_TOGGLES;f++) | 225 | + if(name) |
228 | { | 226 | { |
229 | - if(!strcasecmp(name,toggle_names[f])) | ||
230 | - return f; | 227 | + int f; |
228 | + for(f=0;f<N_TOGGLES;f++) | ||
229 | + { | ||
230 | + if(!strcasecmp(name,toggle_names[f])) | ||
231 | + return f; | ||
232 | + } | ||
231 | } | 233 | } |
232 | - | ||
233 | return -1; | 234 | return -1; |
234 | } | 235 | } |
235 | 236 |