summaryrefslogtreecommitdiff
path: root/media-sound/mpd/files/string_crashfix.patch
diff options
context:
space:
mode:
Diffstat (limited to 'media-sound/mpd/files/string_crashfix.patch')
-rw-r--r--media-sound/mpd/files/string_crashfix.patch74
1 files changed, 0 insertions, 74 deletions
diff --git a/media-sound/mpd/files/string_crashfix.patch b/media-sound/mpd/files/string_crashfix.patch
deleted file mode 100644
index 0d2b7f9..0000000
--- a/media-sound/mpd/files/string_crashfix.patch
+++ /dev/null
@@ -1,74 +0,0 @@
---- mpd-0.20.9/src/util/FormatString.cxx 2017-01-27 10:46:51.000000000 +0300
-+++ mpd-0.20.9_patched/src/util/FormatString.cxx 2017-08-01 23:55:23.781161186 +0300
-@@ -23,42 +23,46 @@
- #include <stdio.h>
- #include <stdlib.h>
-
--#ifdef WIN32
- #include <string.h>
--#endif
-
- AllocatedString<>
- FormatStringV(const char *fmt, va_list args)
- {
--#ifndef WIN32
-- va_list tmp;
-- va_copy(tmp, args);
-- const int length = vsnprintf(NULL, 0, fmt, tmp);
-- va_end(tmp);
--
-- if (length <= 0)
-- /* wtf.. */
-- abort();
--
-- char *buffer = new char[length + 1];
-- vsnprintf(buffer, length + 1, fmt, args);
-- return AllocatedString<>::Donate(buffer);
--#else
-+//#ifndef WIN32
-+// va_list tmp;
-+// va_copy(tmp, args);
-+// const int length = vsnprintf(NULL, 0, fmt, tmp);
-+// va_end(tmp);
-+
-+// if (length <= 0)
-+// /* wtf.. */
-+// abort();
-+//
-+// char *buffer = new char[length + 1];
-+// vsnprintf(buffer, length + 1, fmt, args);
-+// return AllocatedString<>::Donate(buffer);
-+// char *buf = new char[128];
-+// strcpy(buf, "fucked shit");
-+// return AllocatedString<>::Donate(buf);
-+//#else
- /* On mingw32, snprintf() expects a 64 bit integer instead of
- a "long int" for "%li". This is not consistent with our
- expectation, so we're using plain sprintf() here, hoping
- the static buffer is large enough. Sorry for this hack,
- but WIN32 development is so painful, I'm not in the mood to
- do it properly now. */
--
-- char buffer[16384];
-- vsprintf(buffer, fmt, args);
--
-- const size_t length = strlen(buffer);
-- char *p = new char[length + 1];
-- memcpy(p, buffer, length + 1);
-- return AllocatedString<>::Donate(buffer);
--#endif
-+
-+ if(!fmt)
-+ abort();
-+ const int buf_len = 16384;
-+ char buffer[buf_len];
-+ vsnprintf(buffer, buf_len-1, fmt, args);
-+
-+// const size_t length = strlen(buffer);
-+// char *p = new char[length + 1];
-+ char *p = strdup(buffer);
-+ return AllocatedString<>::Donate(p);
-+//#endif
- }
-
- AllocatedString<>