Ticket #2119: some trivial corrections.

Trivial changes in util.h. Type cast in str_move function.

Thanks Vit Rosin for original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2010-03-31 13:17:40 +04:00
parent 933aba001d
commit 9547a991cb
1 changed files with 6 additions and 5 deletions

View File

@ -280,15 +280,16 @@ const char *Q_ (const char *s);
* We can't use str*cpy funs here:
* http://kerneltrap.org/mailarchive/openbsd-misc/2008/5/27/1951294
*/
static inline char * str_move(char * dest, const char * src)
static inline char *
str_move (char *dest, const char *src)
{
size_t n;
assert (dest<=src);
assert (dest <= src);
n = strlen (src) + 1; /* + '\0' */
return memmove (dest, src, n);
return (char *) memmove (dest, src, n);
}
gboolean mc_util_make_backup_if_possible (const char *, const char *);
@ -297,6 +298,6 @@ gboolean mc_util_unlink_backup_if_possible (const char *, const char *);
char *guess_message_value (void);
#define MC_PTR_FREE(ptr) do { g_free(ptr); (ptr) = NULL; } while (0)
#define MC_PTR_FREE(ptr) do { g_free (ptr); (ptr) = NULL; } while (0)
#endif
#endif /* MC_UTIL_H */