diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 0fdfeaa6..655df998 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2034,6 +2034,7 @@ Ville Skytt for reporting a possible crash when shutting down VDR while subtitles are being displayed for fixing some spellings in positioner.h and Doxyfile + for changing '%a' to the POSIX compliant '%m' in all scanf() calls Steffen Beyer for fixing setting the colored button help after deleting a recording in case the next diff --git a/HISTORY b/HISTORY index b8b0fb0c..557a6bf3 100644 --- a/HISTORY +++ b/HISTORY @@ -8032,7 +8032,7 @@ Video Disk Recorder Revision History the last replayed recording (if any) by pressing Ok repeatedly in the Recordings menu. -2013-12-25: Version 2.1.3 +2013-12-28: Version 2.1.3 - Changed the return value of cPositioner::HorizonLongitude() to 0 in case the latitude of the antenna location is beyond +/-81 degrees. @@ -8087,3 +8087,5 @@ Video Disk Recorder Revision History - Added a note to ePlayMode in device.h that VDR itself always uses pmAudioVideo when replaying a recording (suggested by Thomas Reufer). - Fixed some spellings in positioner.h and Doxyfile (thanks to Ville Skyttä). +- Changed '%a' to the POSIX compliant '%m' in all scanf() calls (thanks to Ville + Skyttä). diff --git a/channels.c b/channels.c index 0c9dcedc..61bed541 100644 --- a/channels.c +++ b/channels.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: channels.c 3.2 2013/11/04 10:11:51 kls Exp $ + * $Id: channels.c 3.3 2013/12/28 11:33:08 kls Exp $ */ #include "channels.h" @@ -29,7 +29,7 @@ tChannelID tChannelID::FromString(const char *s) int tid; int sid; int rid = 0; - int fields = sscanf(s, "%a[^-]-%d-%d-%d-%d", &sourcebuf, &nid, &tid, &sid, &rid); + int fields = sscanf(s, "%m[^-]-%d-%d-%d-%d", &sourcebuf, &nid, &tid, &sid, &rid); if (fields == 4 || fields == 5) { int source = cSource::FromString(sourcebuf); free(sourcebuf); @@ -589,7 +589,7 @@ bool cChannel::Parse(const char *s) char *apidbuf = NULL; char *tpidbuf = NULL; char *caidbuf = NULL; - int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%a[^:]:%a[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpidbuf, &caidbuf, &sid, &nid, &tid, &rid); + int fields = sscanf(s, "%m[^:]:%d :%m[^:]:%m[^:] :%d :%m[^:]:%m[^:]:%m[^:]:%m[^:]:%d :%d :%d :%d ", &namebuf, &frequency, ¶mbuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpidbuf, &caidbuf, &sid, &nid, &tid, &rid); if (fields >= 9) { if (fields == 9) { // allow reading of old format diff --git a/diseqc.c b/diseqc.c index 86ee61fe..2517caf6 100644 --- a/diseqc.c +++ b/diseqc.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: diseqc.c 3.2 2013/08/21 09:26:11 kls Exp $ + * $Id: diseqc.c 3.3 2013/12/28 11:33:08 kls Exp $ */ #include "diseqc.h" @@ -228,9 +228,9 @@ bool cDiseqc::Parse(const char *s) devices = CurrentDevices; bool result = false; char *sourcebuf = NULL; - int fields = sscanf(s, "%a[^ ] %d %c %d %a[^\n]", &sourcebuf, &slof, &polarization, &lof, &commands); + int fields = sscanf(s, "%m[^ ] %d %c %d %m[^\n]", &sourcebuf, &slof, &polarization, &lof, &commands); if (fields == 4) - commands = NULL; //XXX Apparently sscanf() doesn't work correctly if the last %a argument results in an empty string + commands = NULL; //XXX Apparently sscanf() doesn't work correctly if the last %m argument results in an empty string if (4 <= fields && fields <= 5) { source = cSource::FromString(sourcebuf); if (Sources.Get(source)) { diff --git a/epg.c b/epg.c index ee784219..096b68cf 100644 --- a/epg.c +++ b/epg.c @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.c 3.2 2013/08/31 13:21:09 kls Exp $ + * $Id: epg.c 3.3 2013/12/28 11:33:08 kls Exp $ */ #include "epg.h" @@ -32,7 +32,7 @@ cString tComponent::ToString(void) bool tComponent::FromString(const char *s) { unsigned int Stream, Type; - int n = sscanf(s, "%X %02X %7s %a[^\n]", &Stream, &Type, language, &description); // 7 = MAXLANGCODE2 - 1 + int n = sscanf(s, "%X %02X %7s %m[^\n]", &Stream, &Type, language, &description); // 7 = MAXLANGCODE2 - 1 if (n != 4 || isempty(description)) { free(description); description = NULL; diff --git a/sources.c b/sources.c index ffaee98a..c2a3dba1 100644 --- a/sources.c +++ b/sources.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: sources.c 3.4 2013/05/23 10:20:28 kls Exp $ + * $Id: sources.c 3.5 2013/12/28 11:33:08 kls Exp $ */ #include "sources.h" @@ -31,7 +31,7 @@ cSource::~cSource() bool cSource::Parse(const char *s) { char *codeBuf = NULL; - if (2 == sscanf(s, "%a[^ ] %a[^\n]", &codeBuf, &description)) + if (2 == sscanf(s, "%m[^ ] %m[^\n]", &codeBuf, &description)) code = FromString(codeBuf); free(codeBuf); return code != stNone && description && *description; diff --git a/timers.c b/timers.c index 9a880e10..3eb80689 100644 --- a/timers.c +++ b/timers.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: timers.c 2.18 2013/03/29 15:37:16 kls Exp $ + * $Id: timers.c 3.1 2013/12/28 11:33:08 kls Exp $ */ #include "timers.h" @@ -296,7 +296,7 @@ bool cTimer::Parse(const char *s) char *filebuffer = NULL; free(aux); aux = NULL; - //XXX Apparently sscanf() doesn't work correctly if the last %a argument + //XXX Apparently sscanf() doesn't work correctly if the last %m argument //XXX results in an empty string (this first occurred when the EIT gathering //XXX was put into a separate thread - don't know why this happens... //XXX As a cure we copy the original string and add a blank. @@ -312,7 +312,7 @@ bool cTimer::Parse(const char *s) s = s2; } bool result = false; - if (8 <= sscanf(s, "%u :%a[^:]:%a[^:]:%d :%d :%d :%d :%a[^:\n]:%a[^\n]", &flags, &channelbuffer, &daybuffer, &start, &stop, &priority, &lifetime, &filebuffer, &aux)) { + if (8 <= sscanf(s, "%u :%m[^:]:%m[^:]:%d :%d :%d :%d :%m[^:\n]:%m[^\n]", &flags, &channelbuffer, &daybuffer, &start, &stop, &priority, &lifetime, &filebuffer, &aux)) { ClrFlags(tfRecording); if (aux && !*skipspace(aux)) { free(aux);