Skip to content

Commit 908660c

Browse files
committed
Avoid maybe uninit warning in libmagic
GCC 5 false positive, gone in newer versions.
1 parent c9ff095 commit 908660c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ext/fileinfo/libmagic.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
22
--- libmagic.orig/apprentice.c 2018-03-11 01:46:42.000000000 +0100
3-
+++ libmagic/apprentice.c 2019-04-12 10:04:15.721646341 +0200
3+
+++ libmagic/apprentice.c 2019-04-15 10:57:47.115181746 +0200
44
@@ -2,7 +2,7 @@
55
* Copyright (c) Ian F. Darwin 1986-1995.
66
* Software written by Ian F. Darwin and others;
@@ -945,7 +945,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
945945
- int fd;
946946
- struct stat st;
947947
+ uint32_t *ptr;
948-
+ uint32_t version, entries, nentries;
948+
+ uint32_t version, entries = 0, nentries;
949949
+ int needsbyteswap;
950950
char *dbname = NULL;
951951
struct magic_map *map;

ext/fileinfo/libmagic/apprentice.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2954,7 +2954,7 @@ private struct magic_map *
29542954
apprentice_map(struct magic_set *ms, const char *fn)
29552955
{
29562956
uint32_t *ptr;
2957-
uint32_t version, entries, nentries;
2957+
uint32_t version, entries = 0, nentries;
29582958
int needsbyteswap;
29592959
char *dbname = NULL;
29602960
struct magic_map *map;

0 commit comments

Comments
 (0)