summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Fontaine <fontaine.fabrice@gmail.com>2020-11-11 15:00:47 +0100
committerJan Kara <jack@suse.cz>2020-11-11 15:04:29 +0100
commit02b222a335527f1031cc9495d8c5ebc1bc5b1d4e (patch)
tree7ecc03d2f81daf6e40dca96db7a7b1b818ed0174
parent0acd4cc6275122fd9864cb7b5d349e65a2622920 (diff)
downloadlinuxquota-02b222a335527f1031cc9495d8c5ebc1bc5b1d4e.tar.gz
quota: Use realloc(3) instead of reallocarray(3)
reallocarray(3) has been added to glibc relatively recently (version 2.26, from 2017) and apparently not all users run new enough glibc. Just use realloc(3) for now since in this case there's no real risk of overflow. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--quota.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/quota.c b/quota.c
index a6ed61f..a60de12 100644
--- a/quota.c
+++ b/quota.c
@@ -385,7 +385,7 @@ int main(int argc, char **argv)
break;
case 259:
fscount++;
- fsnames = reallocarray(fsnames, fscount, sizeof(char *));
+ fsnames = realloc(fsnames, fscount * sizeof(char *));
if (!fsnames)
die(1, _("Not enough memory for filesystem names"));
fsnames[fscount - 1] = optarg;