btrfs-progs: rename __strncpy__null to __strncpy_null

Signed-off-by: David Sterba <dsterba@suse.com>
master
David Sterba 2016-03-24 19:17:53 +01:00
parent c7f72072bd
commit 41f6ae4820
2 changed files with 5 additions and 5 deletions

View File

@ -1683,7 +1683,7 @@ int pretty_size_snprintf(u64 size, char *str, size_t str_size, unsigned unit_mod
}
/*
* __strncpy__null - strncpy with null termination
* __strncpy_null - strncpy with null termination
* @dest: the target array
* @src: the source string
* @n: maximum bytes to copy (size of *dest)
@ -1694,7 +1694,7 @@ int pretty_size_snprintf(u64 size, char *str, size_t str_size, unsigned unit_mod
* byte ('\0'), to the buffer pointed to by dest, up to a maximum
* of n bytes. Then ensure that dest is null-terminated.
*/
char *__strncpy__null(char *dest, const char *src, size_t n)
char *__strncpy_null(char *dest, const char *src, size_t n)
{
strncpy(dest, src, n);
if (n > 0)
@ -2969,7 +2969,7 @@ int arg_copy_path(char *dest, const char *src, int destlen)
if (len >= PATH_MAX || len >= destlen)
return -ENAMETOOLONG;
__strncpy__null(dest, src, destlen);
__strncpy_null(dest, src, destlen);
return 0;
}

View File

@ -160,7 +160,7 @@ int get_fs_info(char *path, struct btrfs_ioctl_fs_info_args *fi_args,
int get_label(const char *btrfs_dev, char *label);
int set_label(const char *btrfs_dev, const char *label);
char *__strncpy__null(char *dest, const char *src, size_t n);
char *__strncpy_null(char *dest, const char *src, size_t n);
int is_block_device(const char *file);
int is_mount_point(const char *file);
int check_arg_type(const char *input);
@ -168,7 +168,7 @@ int open_path_or_dev_mnt(const char *path, DIR **dirstream, int verbose);
int btrfs_open_dir(const char *path, DIR **dirstream, int verbose);
u64 btrfs_device_size(int fd, struct stat *st);
/* Helper to always get proper size of the destination string */
#define strncpy_null(dest, src) __strncpy__null(dest, src, sizeof(dest))
#define strncpy_null(dest, src) __strncpy_null(dest, src, sizeof(dest))
int test_dev_for_mkfs(const char *file, int force_overwrite);
int get_label_mounted(const char *mount_path, char *labelp);
int get_label_unmounted(const char *dev, char *label);