mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 21:16:50 +03:00
strlen() on constant string can be replaced by sizeof()-1
svn path=/trunk/netsurf/; revision=6333
This commit is contained in:
parent
8e4853dd56
commit
aa61544828
@ -1031,7 +1031,7 @@ gboolean nsbeos_openfile_open(beosWidget *widget, gpointer data)
|
||||
current_model->top_level);
|
||||
char *filename = beos_file_chooser_get_filename(
|
||||
beos_FILE_CHOOSER(wndOpenFile));
|
||||
char *url = malloc(strlen(filename) + strlen("file://") + 1);
|
||||
char *url = malloc(strlen(filename) + sizeof("file://"));
|
||||
|
||||
sprintf(url, "file://%s", filename);
|
||||
|
||||
|
@ -486,7 +486,7 @@ void nsgtk_openfile_open(char *filename)
|
||||
{
|
||||
struct browser_window *bw = nsgtk_get_browser_for_gui(
|
||||
current_model->top_level);
|
||||
char *url = malloc(strlen(filename) + strlen("file://") + 1);
|
||||
char *url = malloc(strlen(filename) + sizeof("file://"));
|
||||
|
||||
sprintf(url, "file://%s", filename);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user