str(n)dupa are GNU extensions that duplicate a string, using an alloca'd
buffer. This patch removes their definitions from e.h (which should only
contain E's own API, without fallback definitions for libc functions)
which were wrong anyway (they failed in cases where str(n)dupa was an
actual function, not a macro).
Instead, we replace them depending on context with alloca+memcpy+strlen
or a static buffer (used in contexts where we are sure that the buffer
will contain the string entirely)
@fix
this speed sup dir listing in efm drastically. first the e fm back end
uses an io thread that just spools through everything fast and sends
it over the mainloop to then send by ipc to e.
and on the e side we no longer use the heavy file internal magic using
api calls that wander all over a file for magic numbers - this is
insanely slow and brings listing to a crawl.
here is a patch.
1. free() already null-checks the passed argument, so it is not
necessary to do 'if(x) free(x)'.
2. Moved some '{free(x); x = NULL}' to E_FREE.
3. In e_start_main.c, 'buf' is allocated with the size of the
two arguments + '=', so we don't need to check for lenght;
we should use sprintf().
thanks
Maxime Villard
SVN revision: 81364
I'm attaching a patch for some minor bugs in the e17.
Please take a look at attached patch.
01. missing E_FREE(inst)
File: src/bin/e_exec.c: 347
Function: _e_exec_cb_exec
02. missing null check
File: src/bin/e_fm.c: 10173
Function: _e_fm_error_dialog
I'm not sure, but all other codes always check the return
value of e_fm2_op_registry_entry_get except here.
03. missing free(slave)
File: src/bin/e_fm_ipc.c: 804
Function: _e_fm_ipc_slave_run
04. eina_list_remove after free
File: src/bin/e_fm/e_fm_ipc.c :1325
Function: _e_fm_ipc_cb_fop_trash_idler
05. invalid check for _udisks_del, it might be _udisks_chg.
File: src/bin/e_fm/e_fm_main_udisks.c : 162
Function: _e_fm_main_udisks_test
06. uninitialized gx and gy values
File: src/bin/e_gadcon_popup.c: 172
Function: _e_gadcon_popup_position
These could be changed in e_gadcon_client_geometry_get
if gcc->o_base is null.
07. unnecessary code 'evas = e_win_evas_get(dia->win)'
File: src/bin/e_import_config_dialog.c: 456
Function: e_import_config_dialog_show
08. missing free(sizes)
src/bin/e_randr_11_serialization.c: 136
Function: _11_try_restore_configuration()
09. unnecessary variable output_info
File: src/bin/e_randr_12.c: 560
Function: _output_property_change_event_cb
10. eina_list_remove after free
File: src/bin/e_randr_12_serialization.c : 357
Function: _12_serialized_setup_update
11. no check of the return value of symlink.
File: src/bin/e_widget_fsel.c: 84
Function: _e_wid_fsel_favorites_add
12. no evr->var check before comparing string values
File: src/modules/conf_applications/e_int_config_defapps.c: 432
Function: _basic_apply
13. missing error message or check return value of edje_file_group_exists
File: src/modules/conf_theme/e_int_config_theme.c: 333
Function: _open_test_cb
Anyway, I've added e_util_dialog_show if failed. Is it okay?
14. missing index range check
File: src/modules/gadman/e_mod_config.c: 153
Function: _cb_config
It could read negative array index, because return value of
e_widget_ilist_selected_get might be negative.
BR,
Gwanglim
SVN revision: 80020
using str1 == str2 instead of strcmp assuming all strings are
stringshared. dont ASSUME this unless you 100% KNOW for sure they are.
bad disco stu!
SVN revision: 53128