diff options
author | Lukas Czerner <lczerner@redhat.com> | 2020-06-05 10:14:40 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2020-10-01 16:51:46 -0400 |
commit | 0c6fe31f328e7244164d8a954488f5738caaf915 (patch) | |
tree | 18739582a48bb0d9ba445a7b7a599a6ad16db160 | |
parent | acc905845109b0279e92f1fde03dfd1bfe13342a (diff) | |
download | e2fsprogs-0c6fe31f328e7244164d8a954488f5738caaf915.tar.gz |
e2fsck: use size_t instead of int in string_copy()
len argument in string_copy() is int, but it is used with malloc(),
strlen(), strncpy() and some callers use sizeof() to pass value in. So
it really ought to be size_t rather than int. Fix it.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | e2fsck/e2fsck.h | 2 | ||||
-rw-r--r-- | e2fsck/util.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/e2fsck/e2fsck.h b/e2fsck/e2fsck.h index feb605c7b..7e0895c23 100644 --- a/e2fsck/e2fsck.h +++ b/e2fsck/e2fsck.h @@ -608,7 +608,7 @@ extern void log_err(e2fsck_t ctx, const char *fmt, ...) extern void e2fsck_read_bitmaps(e2fsck_t ctx); extern void e2fsck_write_bitmaps(e2fsck_t ctx); extern void preenhalt(e2fsck_t ctx); -extern char *string_copy(e2fsck_t ctx, const char *str, int len); +extern char *string_copy(e2fsck_t ctx, const char *str, size_t len); extern int fs_proc_check(const char *fs_name); extern int check_for_modules(const char *fs_name); #ifdef RESOURCE_TRACK diff --git a/e2fsck/util.c b/e2fsck/util.c index 8cebd95aa..425fe88e8 100644 --- a/e2fsck/util.c +++ b/e2fsck/util.c @@ -135,7 +135,7 @@ void *e2fsck_allocate_memory(e2fsck_t ctx, unsigned long size, } char *string_copy(e2fsck_t ctx EXT2FS_ATTR((unused)), - const char *str, int len) + const char *str, size_t len) { char *ret; |