aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/list.c3
-rw-r--r--sway/config.c189
-rw-r--r--sway/handlers.c4
3 files changed, 136 insertions, 60 deletions
diff --git a/common/list.c b/common/list.c
index d57234e3..dd864a9b 100644
--- a/common/list.c
+++ b/common/list.c
@@ -5,6 +5,9 @@
5 5
6list_t *create_list(void) { 6list_t *create_list(void) {
7 list_t *list = malloc(sizeof(list_t)); 7 list_t *list = malloc(sizeof(list_t));
8 if (!list) {
9 return NULL;
10 }
8 list->capacity = 10; 11 list->capacity = 10;
9 list->length = 0; 12 list->length = 0;
10 list->items = malloc(sizeof(void*) * list->capacity); 13 list->items = malloc(sizeof(void*) * list->capacity);
diff --git a/sway/config.c b/sway/config.c
index 98109937..b86bacdb 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -29,21 +29,30 @@ struct sway_config *config = NULL;
29static void terminate_swaybar(pid_t pid); 29static void terminate_swaybar(pid_t pid);
30 30
31static void free_variable(struct sway_variable *var) { 31static void free_variable(struct sway_variable *var) {
32 if (!var) {
33 return;
34 }
32 free(var->name); 35 free(var->name);
33 free(var->value); 36 free(var->value);
34 free(var); 37 free(var);
35} 38}
36 39
37static void free_binding(struct sway_binding *bind) { 40static void free_binding(struct sway_binding *bind) {
41 if (!bind) {
42 return;
43 }
38 free_flat_list(bind->keys); 44 free_flat_list(bind->keys);
39 free(bind->command); 45 free(bind->command);
40 free(bind); 46 free(bind);
41} 47}
42 48
43static void free_mode(struct sway_mode *mode) { 49static void free_mode(struct sway_mode *mode) {
50 if (!mode) {
51 return;
52 }
44 free(mode->name); 53 free(mode->name);
45 int i; 54 int i;
46 for (i = 0; i < mode->bindings->length; ++i) { 55 for (i = 0; mode->bindings && i < mode->bindings->length; ++i) {
47 free_binding(mode->bindings->items[i]); 56 free_binding(mode->bindings->items[i]);
48 } 57 }
49 list_free(mode->bindings); 58 list_free(mode->bindings);
@@ -51,13 +60,16 @@ static void free_mode(struct sway_mode *mode) {
51} 60}
52 61
53static void free_bar(struct bar_config *bar) { 62static void free_bar(struct bar_config *bar) {
63 if (!bar) {
64 return;
65 }
54 free(bar->mode); 66 free(bar->mode);
55 free(bar->hidden_state); 67 free(bar->hidden_state);
56 free(bar->status_command); 68 free(bar->status_command);
57 free(bar->font); 69 free(bar->font);
58 free(bar->separator_symbol); 70 free(bar->separator_symbol);
59 int i; 71 int i;
60 for (i = 0; i < bar->bindings->length; ++i) { 72 for (i = 0; bar->bindings && i < bar->bindings->length; ++i) {
61 free_sway_mouse_binding(bar->bindings->items[i]); 73 free_sway_mouse_binding(bar->bindings->items[i]);
62 } 74 }
63 list_free(bar->bindings); 75 list_free(bar->bindings);
@@ -96,16 +108,25 @@ static void free_bar(struct bar_config *bar) {
96} 108}
97 109
98void free_input_config(struct input_config *ic) { 110void free_input_config(struct input_config *ic) {
111 if (!ic) {
112 return;
113 }
99 free(ic->identifier); 114 free(ic->identifier);
100 free(ic); 115 free(ic);
101} 116}
102 117
103void free_output_config(struct output_config *oc) { 118void free_output_config(struct output_config *oc) {
119 if (!oc) {
120 return;
121 }
104 free(oc->name); 122 free(oc->name);
105 free(oc); 123 free(oc);
106} 124}
107 125
108static void free_workspace_output(struct workspace_output *wo) { 126static void free_workspace_output(struct workspace_output *wo) {
127 if (!wo) {
128 return;
129 }
109 free(wo->output); 130 free(wo->output);
110 free(wo->workspace); 131 free(wo->workspace);
111 free(wo); 132 free(wo);
@@ -134,6 +155,10 @@ void pid_workspace_add(struct pid_workspace *pw) {
134 struct pid_workspace *list_pw = NULL; 155 struct pid_workspace *list_pw = NULL;
135 struct timespec ts; 156 struct timespec ts;
136 time_t *now = malloc(sizeof(time_t)); 157 time_t *now = malloc(sizeof(time_t));
158 if (!now) {
159 sway_log(L_ERROR, "Allocating time for pid_workspace failed");
160 return;
161 }
137 162
138 pid_workspace_cleanup(); 163 pid_workspace_cleanup();
139 164
@@ -168,65 +193,74 @@ void free_pid_workspace(struct pid_workspace *pw) {
168} 193}
169 194
170void free_command_policy(struct command_policy *policy) { 195void free_command_policy(struct command_policy *policy) {
196 if (!policy) {
197 return;
198 }
171 free(policy->command); 199 free(policy->command);
172 free(policy); 200 free(policy);
173} 201}
174 202
175void free_feature_policy(struct feature_policy *policy) { 203void free_feature_policy(struct feature_policy *policy) {
204 if (!policy) {
205 return;
206 }
176 free(policy->program); 207 free(policy->program);
177 free(policy); 208 free(policy);
178} 209}
179 210
180void free_config(struct sway_config *config) { 211void free_config(struct sway_config *config) {
212 if (!config) {
213 return;
214 }
181 int i; 215 int i;
182 for (i = 0; i < config->symbols->length; ++i) { 216 for (i = 0; config->symbols && i < config->symbols->length; ++i) {
183 free_variable(config->symbols->items[i]); 217 free_variable(config->symbols->items[i]);
184 } 218 }
185 list_free(config->symbols); 219 list_free(config->symbols);
186 220
187 for (i = 0; i < config->modes->length; ++i) { 221 for (i = 0; config->modes && i < config->modes->length; ++i) {
188 free_mode(config->modes->items[i]); 222 free_mode(config->modes->items[i]);
189 } 223 }
190 list_free(config->modes); 224 list_free(config->modes);
191 225
192 for (i = 0; i < config->bars->length; ++i) { 226 for (i = 0; config->bars && i < config->bars->length; ++i) {
193 free_bar(config->bars->items[i]); 227 free_bar(config->bars->items[i]);
194 } 228 }
195 list_free(config->bars); 229 list_free(config->bars);
196 230
197 free_flat_list(config->cmd_queue); 231 free_flat_list(config->cmd_queue);
198 232
199 for (i = 0; i < config->workspace_outputs->length; ++i) { 233 for (i = 0; config->workspace_outputs && i < config->workspace_outputs->length; ++i) {
200 free_workspace_output(config->workspace_outputs->items[i]); 234 free_workspace_output(config->workspace_outputs->items[i]);
201 } 235 }
202 list_free(config->workspace_outputs); 236 list_free(config->workspace_outputs);
203 237
204 for (i = 0; i < config->pid_workspaces->length; ++i) { 238 for (i = 0; config->pid_workspaces && i < config->pid_workspaces->length; ++i) {
205 free_pid_workspace(config->pid_workspaces->items[i]); 239 free_pid_workspace(config->pid_workspaces->items[i]);
206 } 240 }
207 list_free(config->pid_workspaces); 241 list_free(config->pid_workspaces);
208 242
209 for (i = 0; i < config->criteria->length; ++i) { 243 for (i = 0; config->criteria && i < config->criteria->length; ++i) {
210 free_criteria(config->criteria->items[i]); 244 free_criteria(config->criteria->items[i]);
211 } 245 }
212 list_free(config->criteria); 246 list_free(config->criteria);
213 247
214 for (i = 0; i < config->input_configs->length; ++i) { 248 for (i = 0; config->input_configs && i < config->input_configs->length; ++i) {
215 free_input_config(config->input_configs->items[i]); 249 free_input_config(config->input_configs->items[i]);
216 } 250 }
217 list_free(config->input_configs); 251 list_free(config->input_configs);
218 252
219 for (i = 0; i < config->output_configs->length; ++i) { 253 for (i = 0; config->output_configs && i < config->output_configs->length; ++i) {
220 free_output_config(config->output_configs->items[i]); 254 free_output_config(config->output_configs->items[i]);
221 } 255 }
222 list_free(config->output_configs); 256 list_free(config->output_configs);
223 257
224 for (i = 0; i < config->command_policies->length; ++i) { 258 for (i = 0; config->command_policies && i < config->command_policies->length; ++i) {
225 free_command_policy(config->command_policies->items[i]); 259 free_command_policy(config->command_policies->items[i]);
226 } 260 }
227 list_free(config->command_policies); 261 list_free(config->command_policies);
228 262
229 for (i = 0; i < config->feature_policies->length; ++i) { 263 for (i = 0; config->feature_policies && i < config->feature_policies->length; ++i) {
230 free_feature_policy(config->feature_policies->items[i]); 264 free_feature_policy(config->feature_policies->items[i]);
231 } 265 }
232 list_free(config->feature_policies); 266 list_free(config->feature_policies);
@@ -243,37 +277,37 @@ void free_config(struct sway_config *config) {
243 277
244 278
245static bool file_exists(const char *path) { 279static bool file_exists(const char *path) {
246 return access(path, R_OK) != -1; 280 return path && access(path, R_OK) != -1;
247} 281}
248 282
249static void config_defaults(struct sway_config *config) { 283static void config_defaults(struct sway_config *config) {
250 config->symbols = create_list(); 284 if (!(config->symbols = create_list())) goto cleanup;
251 config->modes = create_list(); 285 if (!(config->modes = create_list())) goto cleanup;
252 config->bars = create_list(); 286 if (!(config->bars = create_list())) goto cleanup;
253 config->workspace_outputs = create_list(); 287 if (!(config->workspace_outputs = create_list())) goto cleanup;
254 config->pid_workspaces = create_list(); 288 if (!(config->pid_workspaces = create_list())) goto cleanup;
255 config->criteria = create_list(); 289 if (!(config->criteria = create_list())) goto cleanup;
256 config->input_configs = create_list(); 290 if (!(config->input_configs = create_list())) goto cleanup;
257 config->output_configs = create_list(); 291 if (!(config->output_configs = create_list())) goto cleanup;
258 292
259 config->cmd_queue = create_list(); 293 if (!(config->cmd_queue = create_list())) goto cleanup;
260 294
261 config->current_mode = malloc(sizeof(struct sway_mode)); 295 if (!(config->current_mode = malloc(sizeof(struct sway_mode)))) goto cleanup;
262 config->current_mode->name = malloc(sizeof("default")); 296 if (!(config->current_mode->name = malloc(sizeof("default")))) goto cleanup;
263 strcpy(config->current_mode->name, "default"); 297 strcpy(config->current_mode->name, "default");
264 config->current_mode->bindings = create_list(); 298 if (!(config->current_mode->bindings = create_list())) goto cleanup;
265 list_add(config->modes, config->current_mode); 299 list_add(config->modes, config->current_mode);
266 300
267 config->floating_mod = 0; 301 config->floating_mod = 0;
268 config->dragging_key = M_LEFT_CLICK; 302 config->dragging_key = M_LEFT_CLICK;
269 config->resizing_key = M_RIGHT_CLICK; 303 config->resizing_key = M_RIGHT_CLICK;
270 config->floating_scroll_up_cmd = strdup(""); 304 if (!(config->floating_scroll_up_cmd = strdup(""))) goto cleanup;
271 config->floating_scroll_down_cmd = strdup(""); 305 if (!(config->floating_scroll_down_cmd = strdup(""))) goto cleanup;
272 config->floating_scroll_left_cmd = strdup(""); 306 if (!(config->floating_scroll_left_cmd = strdup(""))) goto cleanup;
273 config->floating_scroll_right_cmd = strdup(""); 307 if (!(config->floating_scroll_right_cmd = strdup(""))) goto cleanup;
274 config->default_layout = L_NONE; 308 config->default_layout = L_NONE;
275 config->default_orientation = L_NONE; 309 config->default_orientation = L_NONE;
276 config->font = strdup("monospace 10"); 310 if (!(config->font = strdup("monospace 10"))) goto cleanup;
277 config->font_height = get_font_text_height(config->font); 311 config->font_height = get_font_text_height(config->font);
278 312
279 // floating view 313 // floating view
@@ -297,9 +331,9 @@ static void config_defaults(struct sway_config *config) {
297 config->gaps_inner = 0; 331 config->gaps_inner = 0;
298 config->gaps_outer = 0; 332 config->gaps_outer = 0;
299 333
300 config->active_bar_modifiers = create_list(); 334 if (!(config->active_bar_modifiers = create_list())) goto cleanup;
301 335
302 config->config_chain = create_list(); 336 if (!(config->config_chain = create_list())) goto cleanup;
303 config->current_config = NULL; 337 config->current_config = NULL;
304 338
305 // borders 339 // borders
@@ -343,9 +377,13 @@ static void config_defaults(struct sway_config *config) {
343 config->border_colors.background = 0xFFFFFFFF; 377 config->border_colors.background = 0xFFFFFFFF;
344 378
345 // Security 379 // Security
346 config->command_policies = create_list(); 380 if (!(config->command_policies = create_list())) goto cleanup;
347 config->feature_policies = create_list(); 381 if (!(config->feature_policies = create_list())) goto cleanup;
348 config->ipc_policy = UINT32_MAX; 382 config->ipc_policy = UINT32_MAX;
383
384 return;
385cleanup:
386 sway_abort("Unable to allocate config structures");
349} 387}
350 388
351static int compare_modifiers(const void *left, const void *right) { 389static int compare_modifiers(const void *left, const void *right) {
@@ -386,11 +424,15 @@ static char *get_config_path(void) {
386 if (!getenv("XDG_CONFIG_HOME")) { 424 if (!getenv("XDG_CONFIG_HOME")) {
387 char *home = getenv("HOME"); 425 char *home = getenv("HOME");
388 char *config_home = malloc(strlen(home) + strlen("/.config") + 1); 426 char *config_home = malloc(strlen(home) + strlen("/.config") + 1);
389 strcpy(config_home, home); 427 if (!config_home) {
390 strcat(config_home, "/.config"); 428 sway_log(L_ERROR, "Unable to allocate $HOME/.config");
391 setenv("XDG_CONFIG_HOME", config_home, 1); 429 } else {
392 sway_log(L_DEBUG, "Set XDG_CONFIG_HOME to %s", config_home); 430 strcpy(config_home, home);
393 free(config_home); 431 strcat(config_home, "/.config");
432 setenv("XDG_CONFIG_HOME", config_home, 1);
433 sway_log(L_DEBUG, "Set XDG_CONFIG_HOME to %s", config_home);
434 free(config_home);
435 }
394 } 436 }
395 437
396 wordexp_t p; 438 wordexp_t p;
@@ -491,6 +533,10 @@ static bool load_include_config(const char *path, const char *parent_dir, struct
491 if (len >= 1 && path[0] != '/') { 533 if (len >= 1 && path[0] != '/') {
492 len = len + strlen(parent_dir) + 2; 534 len = len + strlen(parent_dir) + 2;
493 full_path = malloc(len * sizeof(char)); 535 full_path = malloc(len * sizeof(char));
536 if (!full_path) {
537 sway_log(L_ERROR, "Unable to allocate full path to included config");
538 return false;
539 }
494 snprintf(full_path, len, "%s/%s", parent_dir, path); 540 snprintf(full_path, len, "%s/%s", parent_dir, path);
495 } 541 }
496 542
@@ -819,6 +865,10 @@ static void invoke_swaybar(struct bar_config *bar) {
819 // run custom swaybar 865 // run custom swaybar
820 int len = strlen(bar->swaybar_command) + strlen(bar->id) + 5; 866 int len = strlen(bar->swaybar_command) + strlen(bar->id) + 5;
821 char *command = malloc(len * sizeof(char)); 867 char *command = malloc(len * sizeof(char));
868 if (!command) {
869 sway_log(L_ERROR, "Unable to allocate swaybar command string");
870 return;
871 }
822 snprintf(command, len, "%s -b %s", bar->swaybar_command, bar->id); 872 snprintf(command, len, "%s -b %s", bar->swaybar_command, bar->id);
823 873
824 char *const cmd[] = { 874 char *const cmd[] = {
@@ -1055,6 +1105,11 @@ char *do_var_replacement(char *str) {
1055 if (strncmp(find, var->name, vnlen) == 0) { 1105 if (strncmp(find, var->name, vnlen) == 0) {
1056 int vvlen = strlen(var->value); 1106 int vvlen = strlen(var->value);
1057 char *newstr = malloc(strlen(str) - vnlen + vvlen + 1); 1107 char *newstr = malloc(strlen(str) - vnlen + vvlen + 1);
1108 if (!newstr) {
1109 sway_log(L_ERROR,
1110 "Unable to allocate replacement during variable expansion");
1111 break;
1112 }
1058 char *newptr = newstr; 1113 char *newptr = newstr;
1059 int offset = find - str; 1114 int offset = find - str;
1060 strncpy(newptr, str, offset); 1115 strncpy(newptr, str, offset);
@@ -1188,6 +1243,9 @@ void free_sway_mouse_binding(struct sway_mouse_binding *binding) {
1188 1243
1189struct sway_binding *sway_binding_dup(struct sway_binding *sb) { 1244struct sway_binding *sway_binding_dup(struct sway_binding *sb) {
1190 struct sway_binding *new_sb = malloc(sizeof(struct sway_binding)); 1245 struct sway_binding *new_sb = malloc(sizeof(struct sway_binding));
1246 if (!new_sb) {
1247 return NULL;
1248 }
1191 1249
1192 new_sb->order = sb->order; 1250 new_sb->order = sb->order;
1193 new_sb->modifiers = sb->modifiers; 1251 new_sb->modifiers = sb->modifiers;
@@ -1197,6 +1255,10 @@ struct sway_binding *sway_binding_dup(struct sway_binding *sb) {
1197 int i; 1255 int i;
1198 for (i = 0; i < sb->keys->length; ++i) { 1256 for (i = 0; i < sb->keys->length; ++i) {
1199 xkb_keysym_t *key = malloc(sizeof(xkb_keysym_t)); 1257 xkb_keysym_t *key = malloc(sizeof(xkb_keysym_t));
1258 if (!key) {
1259 free_sway_binding(new_sb);
1260 return NULL;
1261 }
1200 *key = *(xkb_keysym_t *)sb->keys->items[i]; 1262 *key = *(xkb_keysym_t *)sb->keys->items[i];
1201 list_add(new_sb->keys, key); 1263 list_add(new_sb->keys, key);
1202 } 1264 }
@@ -1207,13 +1269,16 @@ struct sway_binding *sway_binding_dup(struct sway_binding *sb) {
1207struct bar_config *default_bar_config(void) { 1269struct bar_config *default_bar_config(void) {
1208 struct bar_config *bar = NULL; 1270 struct bar_config *bar = NULL;
1209 bar = malloc(sizeof(struct bar_config)); 1271 bar = malloc(sizeof(struct bar_config));
1210 bar->mode = strdup("dock"); 1272 if (!bar) {
1211 bar->hidden_state = strdup("hide"); 1273 return NULL;
1274 }
1275 if (!(bar->mode = strdup("dock"))) goto cleanup;
1276 if (!(bar->hidden_state = strdup("hide"))) goto cleanup;
1212 bar->modifier = WLC_BIT_MOD_LOGO; 1277 bar->modifier = WLC_BIT_MOD_LOGO;
1213 bar->outputs = NULL; 1278 bar->outputs = NULL;
1214 bar->position = DESKTOP_SHELL_PANEL_POSITION_BOTTOM; 1279 bar->position = DESKTOP_SHELL_PANEL_POSITION_BOTTOM;
1215 bar->bindings = create_list(); 1280 if (!(bar->bindings = create_list())) goto cleanup;
1216 bar->status_command = strdup("while :; do date +'%Y-%m-%d %l:%M:%S %p' && sleep 1; done"); 1281 if (!(bar->status_command = strdup("while :; do date +'%Y-%m-%d %l:%M:%S %p' && sleep 1; done"))) goto cleanup;
1217 bar->pango_markup = false; 1282 bar->pango_markup = false;
1218 bar->swaybar_command = NULL; 1283 bar->swaybar_command = NULL;
1219 bar->font = NULL; 1284 bar->font = NULL;
@@ -1227,21 +1292,21 @@ struct bar_config *default_bar_config(void) {
1227 bar->verbose = false; 1292 bar->verbose = false;
1228 bar->pid = 0; 1293 bar->pid = 0;
1229 // set default colors 1294 // set default colors
1230 bar->colors.background = strndup("#000000ff", 9); 1295 if (!(bar->colors.background = strndup("#000000ff", 9))) goto cleanup;
1231 bar->colors.statusline = strndup("#ffffffff", 9); 1296 if (!(bar->colors.statusline = strndup("#ffffffff", 9))) goto cleanup;
1232 bar->colors.separator = strndup("#666666ff", 9); 1297 if (!(bar->colors.separator = strndup("#666666ff", 9))) goto cleanup;
1233 bar->colors.focused_workspace_border = strndup("#4c7899ff", 9); 1298 if (!(bar->colors.focused_workspace_border = strndup("#4c7899ff", 9))) goto cleanup;
1234 bar->colors.focused_workspace_bg = strndup("#285577ff", 9); 1299 if (!(bar->colors.focused_workspace_bg = strndup("#285577ff", 9))) goto cleanup;
1235 bar->colors.focused_workspace_text = strndup("#ffffffff", 9); 1300 if (!(bar->colors.focused_workspace_text = strndup("#ffffffff", 9))) goto cleanup;
1236 bar->colors.active_workspace_border = strndup("#333333ff", 9); 1301 if (!(bar->colors.active_workspace_border = strndup("#333333ff", 9))) goto cleanup;
1237 bar->colors.active_workspace_bg = strndup("#5f676aff", 9); 1302 if (!(bar->colors.active_workspace_bg = strndup("#5f676aff", 9))) goto cleanup;
1238 bar->colors.active_workspace_text = strndup("#ffffffff", 9); 1303 if (!(bar->colors.active_workspace_text = strndup("#ffffffff", 9))) goto cleanup;
1239 bar->colors.inactive_workspace_border = strndup("#333333ff", 9); 1304 if (!(bar->colors.inactive_workspace_border = strndup("#333333ff", 9))) goto cleanup;
1240 bar->colors.inactive_workspace_bg = strndup("#222222ff", 9); 1305 if (!(bar->colors.inactive_workspace_bg = strndup("#222222ff", 9))) goto cleanup;
1241 bar->colors.inactive_workspace_text = strndup("#888888ff", 9); 1306 if (!(bar->colors.inactive_workspace_text = strndup("#888888ff", 9))) goto cleanup;
1242 bar->colors.urgent_workspace_border = strndup("#2f343aff", 9); 1307 if (!(bar->colors.urgent_workspace_border = strndup("#2f343aff", 9))) goto cleanup;
1243 bar->colors.urgent_workspace_bg = strndup("#900000ff", 9); 1308 if (!(bar->colors.urgent_workspace_bg = strndup("#900000ff", 9))) goto cleanup;
1244 bar->colors.urgent_workspace_text = strndup("#ffffffff", 9); 1309 if (!(bar->colors.urgent_workspace_text = strndup("#ffffffff", 9))) goto cleanup;
1245 // if the following colors stay undefined, they fall back to background, 1310 // if the following colors stay undefined, they fall back to background,
1246 // statusline, separator and urgent_workspace_*. 1311 // statusline, separator and urgent_workspace_*.
1247 bar->colors.focused_background = NULL; 1312 bar->colors.focused_background = NULL;
@@ -1254,4 +1319,8 @@ struct bar_config *default_bar_config(void) {
1254 list_add(config->bars, bar); 1319 list_add(config->bars, bar);
1255 1320
1256 return bar; 1321 return bar;
1322
1323cleanup:
1324 free_bar(bar);
1325 return NULL;
1257} 1326}
diff --git a/sway/handlers.c b/sway/handlers.c
index 86a976d8..23a994b4 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -571,6 +571,10 @@ static void handle_binding_command(struct sway_binding *binding) {
571 // binding since it will be gone after the reload has completed. 571 // binding since it will be gone after the reload has completed.
572 if (strcasecmp(binding->command, "reload") == 0) { 572 if (strcasecmp(binding->command, "reload") == 0) {
573 binding_copy = sway_binding_dup(binding); 573 binding_copy = sway_binding_dup(binding);
574 if (!binding_copy) {
575 sway_log(L_ERROR, "Unable to duplicate binding during reload");
576 return;
577 }
574 reload = true; 578 reload = true;
575 } 579 }
576 580