1 diff -ru live/groupsock/Groupsock.cpp live-patched/groupsock/Groupsock.cpp
2 --- live/groupsock/Groupsock.cpp Thu Nov 6 03:53:15 2003
3 +++ live-patched/groupsock/Groupsock.cpp Sun Dec 7 21:30:15 2003
5 #if defined(__WIN32__) || defined(_WIN32)
8 -#include <strstream.h>
13 diff -ru live/groupsock/NetInterface.cpp live-patched/groupsock/NetInterface.cpp
14 --- live/groupsock/NetInterface.cpp Thu Nov 6 03:53:15 2003
15 +++ live-patched/groupsock/NetInterface.cpp Sun Dec 7 21:30:30 2003
17 #if defined(__WIN32__) || defined(_WIN32)
20 -#include <strstream.h>
24 ////////// NetInterface //////////
25 --- live/liveMedia/RTSPClient.cpp 2005-10-28 18:54:17.000000000 +0200
26 +++ live-patched/liveMedia/RTSPClient.cpp 2005-10-28 22:04:54.000000000 +0200
28 #define _strncasecmp strncasecmp
31 -// Experimental support for temporarily setting the locale (e.g., to POSIX,
32 -// for parsing or printing floating-point numbers in protocol headers).
44 - Locale(char const* newLocale, int category = LC_NUMERIC)
45 - : fCategory(category) {
47 - fPrevLocale = strDup(setlocale(category, NULL));
48 - setlocale(category, newLocale);
51 +/* Radix safe (always uses .) printf and friends */
52 +int radix_safe_sprintf( char *str, const char *format, ...)
56 + char *locale = NULL;
60 - if (fPrevLocale != NULL) {
61 - setlocale(fCategory, fPrevLocale);
62 - delete[] fPrevLocale;
66 + locale = strDup( setlocale( LC_NUMERIC, NULL ) );
67 + setlocale( LC_NUMERIC, "C" );
69 + va_start( args, format );
70 + result = vsprintf(str, format, args );
77 + setlocale( LC_NUMERIC, locale );
83 +int radix_safe_sscanf( const char *str, const char *format, ...)
87 + char *locale = NULL;
89 + locale = strDup( setlocale( LC_NUMERIC, NULL ) );
90 + setlocale( LC_NUMERIC, "C" );
92 + va_start( args, format );
93 + result = vsscanf(str, format, args );
96 + setlocale( LC_NUMERIC, locale );
103 ////////// RTSPClient //////////
105 // This is the default value; we don't need a "Scale:" header:
109 - sprintf(buf, "Scale: %f\r\n", scale);
110 + radix_safe_sprintf(buf, "Scale: %f\r\n", scale);
114 @@ -962,12 +968,10 @@
116 } else if (end < 0) {
117 // There's no end time:
119 - sprintf(buf, "Range: npt=%.3f-\r\n", start);
120 + radix_safe_sprintf(buf, "Range: npt=%.3f-\r\n", start);
122 // There's both a start and an end time; include them both in the "Range:" hdr
124 - sprintf(buf, "Range: npt=%.3f-%.3f\r\n", start, end);
125 + radix_safe_sprintf(buf, "Range: npt=%.3f-%.3f\r\n", start, end);
129 @@ -2153,8 +2157,7 @@
130 if (_strncasecmp(line, "Scale: ", 7) != 0) return False;
134 - return sscanf(line, "%f", &scale) == 1;
135 + return radix_safe_sscanf(line, "%f", &scale) == 1;
138 Boolean RTSPClient::parseGetParameterHeader(char const* line,