From 815e7eb5efbd6db29863a6a950849c451124fb2e Mon Sep 17 00:00:00 2001 From: Rick Ohnemus Date: Thu, 15 Sep 2022 19:31:05 -0700 Subject: [PATCH] Fixed "note:" output when compiling filemagic.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Increased version string temporary buffers from 8 to 16 bytes to suppress the following note, and 17 or 18 other lines of output, when compiling filemagic.c: note: ‘sprintf’ output between 5 and 14 bytes into a destination of size 8 --- ext/filemagic/filemagic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/filemagic/filemagic.c b/ext/filemagic/filemagic.c index f63b8c2..2d3b26b 100644 --- a/ext/filemagic/filemagic.c +++ b/ext/filemagic/filemagic.c @@ -3,7 +3,7 @@ /* Returns the magic version */ static VALUE rb_magic_version(VALUE klass) { - char version[8] = "0"; + char version[16] = "0"; #ifdef HAVE_MAGIC_VERSION RB_MAGIC_SET_VERSION(magic_version() / 100, magic_version() % 100) #endif @@ -208,7 +208,7 @@ RB_MAGIC_APPRENTICE(compile) void Init_ruby_filemagic() { - char version[8] = "0"; + char version[16] = "0"; cFileMagic = rb_define_class("FileMagic", rb_cObject); #if defined(FILE_VERSION_MAJOR)