summaryrefslogtreecommitdiff
path: root/dpkg-split
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2011-03-13 23:32:30 +0100
committerGuillem Jover <guillem@debian.org>2011-03-14 07:21:56 +0100
commitdf6a6091b3e420b12286dbde56ef86cf0230c2b4 (patch)
tree381cc943bed9a418d75aba38377acfbe019e412b /dpkg-split
parent79a67e901e0ce82944d33f13d0830fe256f9a39c (diff)
downloaddpkg-df6a6091b3e420b12286dbde56ef86cf0230c2b4.tar.gz
dpkg-split: Use a constant expression to declare an array
Although usually the compiler should replace strlen(literal) with a built-in, it might not, and it's more predictable to use a constant expression using sizeof() instead to avoid making it a variable length array. This fixes a warning with latest gcc and -Wvla.
Diffstat (limited to 'dpkg-split')
-rw-r--r--dpkg-split/info.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dpkg-split/info.c b/dpkg-split/info.c
index 3780c434d..e92adfdac 100644
--- a/dpkg-split/info.c
+++ b/dpkg-split/info.c
@@ -75,7 +75,7 @@ struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir)
size_t thisilen;
unsigned int templong;
- char magicbuf[strlen(DPKG_AR_MAGIC)], *rip, *partnums, *slash;
+ char magicbuf[sizeof(DPKG_AR_MAGIC) - 1], *rip, *partnums, *slash;
struct ar_hdr arh;
int c;
struct stat stab;