flac_mac patches from Janne Hyvärinen <cse@sci.fi>.
authorErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 1 Apr 2013 19:37:08 +0000 (06:37 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 1 Apr 2013 19:37:13 +0000 (06:37 +1100)
src/monkeys_audio_utilities/flac_mac/flac_mac.vcproj
src/monkeys_audio_utilities/flac_mac/main.c

index 6d80508..7b86e03 100644 (file)
@@ -39,6 +39,7 @@
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
+                               AdditionalIncludeDirectories="..\..\..\include"\r
                                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                FavorSizeOrSpeed="1"\r
                                OmitFramePointers="true"\r
                                WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories="..\..\..\include"\r
                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;"\r
                                RuntimeLibrary="0"\r
                                BufferSecurityCheck="false"\r
                                FavorSizeOrSpeed="1"\r
                                OmitFramePointers="true"\r
                                WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories="..\..\..\include"\r
                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
                                RuntimeLibrary="0"\r
                                BufferSecurityCheck="false"\r
index e8582a4..8c8fa3d 100644 (file)
@@ -33,6 +33,7 @@
 #include<process.h>
 #include<winbase.h>
 
+#include "share/compat.h"
 #include "share/safe_str.h"
 
 static int execit(char *prog, char *args);
@@ -106,8 +107,8 @@ int main(int argc, char *argv[])
        flac_snprintf(options, sizeof (options), "-%d", flac_level);
        for(i = opt_arg; i < argc; i++)
                if(argv[i][0] == '-') {
-                       safe_strncat(options, " ");
-                       safe_strncat(options, argv[i]);
+                       safe_strncat(options, " ", sizeof(options));
+                       safe_strncat(options, argv[i], sizeof(options));
                }
        flac_snprintf(cmdline, sizeof (cmdline), "\"%s\" %s -o \"%s\" \"%s\"", prog, options, argv[to_arg], argv[from_arg]);
 
@@ -131,8 +132,8 @@ int main(int argc, char *argv[])
 
                /* for the full 'from' and 'to' paths for the renamer process */
                p = strrchr(argv[from_arg],'\\');
-               safe_strncat(from, p? p+1 : argv[from_arg]);
-               safe_strncpy(to, from, sizeof(to));
+               safe_strncat(from, p? p+1 : argv[from_arg], sizeof(from));
+               safe_strncpy(to, from, sizeof(to), sizeof(to));
 
                cptr = strrchr(from,'.');
                if(cptr == NULL)