Skip to content

Commit

Permalink
fix undefined behaviour on gcc 7.1.X caused by uninitialized first st…
Browse files Browse the repository at this point in the history
…rain (fixes #12)
  • Loading branch information
Francesco149 committed Oct 5, 2017
1 parent af5064a commit 8f0a247
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion oppai.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

#define OPPAI_VERSION_MAJOR 1
#define OPPAI_VERSION_MINOR 1
#define OPPAI_VERSION_PATCH 25
#define OPPAI_VERSION_PATCH 26

/* if your compiler doesn't have stdint, define this */
#ifdef OPPAI_NOSTDINT
Expand Down Expand Up @@ -1452,6 +1452,7 @@ int32_t p_objects(struct parser* pa, struct slice* line)
struct slice elements[11];
uint32_t tmp_type;

memset(&obj.strains, 0, sizeof(obj.strains));
obj.is_single = 0;
obj.nsound_types = 0;
obj.sound_types = 0;
Expand Down

0 comments on commit 8f0a247

Please sign in to comment.