Fix "for loop initial declarations only in C99" compile error
authorMark Drayton <mbd@fb.com>
Tue, 21 Feb 2017 22:25:57 +0000 (22:25 +0000)
committerMark Drayton <mbd@fb.com>
Tue, 21 Feb 2017 22:25:57 +0000 (22:25 +0000)
src/cc/bcc_elf.c

index 7a82665..8a5136f 100644 (file)
@@ -246,7 +246,8 @@ static int find_buildid(Elf *e, char *buildid) {
 
   char *buf = (char *)data->d_buf + 16;
   size_t length = data->d_size - 16;
-  for (size_t i = 0; i < length; ++i) {
+  size_t i = 0;
+  for (i = 0; i < length; ++i) {
     sprintf(buildid + (i * 2), "%02hhx", buf[i]);
   }