fix(review): address PR #130 review
- proftest: declare the _mkdir_recursive loop index inside the for. - xmpp/presence: shorten the resource-snapshot comment to one line. - command/cmd_funcs: report the /vcard remove index error via cons_show_error. - common: replace g_assert in g_diff_to_gsize with a log_error + return 0 (moved out of the header into common.c); take get_random_string length as size_t instead of asserting non-negative. - otr: drop the change-narrating comment on the whitespace memmove. Refs #112
This commit is contained in:
11
src/common.h
11
src/common.h
@@ -158,14 +158,7 @@ gboolean create_dir(const char* name);
|
||||
gboolean copy_file(const char* const src, const char* const target, const gboolean overwrite_existing);
|
||||
char* str_replace(const char* string, const char* substr, const char* replacement);
|
||||
gboolean strtoi_range(const char* str, int* saveptr, int min, int max, char** err_msg);
|
||||
|
||||
// Pointer-diff to gsize for callers that know end >= start by construction.
|
||||
static inline gsize
|
||||
g_diff_to_gsize(const void* end, const void* start)
|
||||
{
|
||||
g_assert(end >= start);
|
||||
return (gsize)((const char*)end - (const char*)start);
|
||||
}
|
||||
gsize g_diff_to_gsize(const void* end, const void* start);
|
||||
int utf8_display_len(const char* const str);
|
||||
gchar* str_xml_sanitize(const char* const str);
|
||||
|
||||
@@ -186,7 +179,7 @@ int is_regular_file(const char* path);
|
||||
int is_dir(const char* path);
|
||||
void get_file_paths_recursive(const char* directory, GSList** contents);
|
||||
|
||||
gchar* get_random_string(int length);
|
||||
gchar* get_random_string(size_t length);
|
||||
|
||||
gboolean call_external(gchar** argv);
|
||||
gchar** format_call_external_argv(const char* template_fmt, const char* url, const char* filename);
|
||||
|
||||
Reference in New Issue
Block a user