mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	Fixed reading timers.conf and channels.conf that contain blanks after numeric values
This commit is contained in:
		
							
								
								
									
										2
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -826,3 +826,5 @@ Video Disk Recorder Revision History | ||||
|   to enter the "Recordings" menu. | ||||
| - Updated 'channels.conf' for the "Bundesliga" channels of Premiere World | ||||
|   (thanks to Helmut Sch<63>chner). | ||||
| - Fixed reading timers.conf and channels.conf that contain blanks after numeric | ||||
|   values. | ||||
|   | ||||
							
								
								
									
										14
									
								
								config.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								config.c
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
|  * See the main source file 'vdr.c' for copyright information and | ||||
|  * how to reach the author. | ||||
|  * | ||||
|  * $Id: config.c 1.75 2001/10/19 13:14:09 kls Exp $ | ||||
|  * $Id: config.c 1.76 2001/10/20 13:09:38 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| #include "config.h" | ||||
| @@ -14,6 +14,10 @@ | ||||
| #include "i18n.h" | ||||
| #include "interface.h" | ||||
|  | ||||
| // IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d' | ||||
| // format characters in order to allow any number of blanks after a numeric | ||||
| // value! | ||||
|  | ||||
| // -- cKeys ------------------------------------------------------------------ | ||||
|  | ||||
| tKey keyTable[] = { // "Up" and "Down" must be the first two keys! | ||||
| @@ -251,16 +255,16 @@ bool cChannel::Parse(const char *s) | ||||
|   else { | ||||
|      groupSep = false; | ||||
|      char *apidbuf = NULL; | ||||
|      int fields = sscanf(s, "%a[^:]:%d:%c:%d:%d:%d:%a[^:]:%d:%d:%d", &buffer, &frequency, &polarization, &diseqc, &srate, &vpid, &apidbuf, &tpid, &ca, &pnr); | ||||
|      int fields = sscanf(s, "%a[^:]:%d :%c:%d :%d :%d :%a[^:]:%d :%d :%d ", &buffer, &frequency, &polarization, &diseqc, &srate, &vpid, &apidbuf, &tpid, &ca, &pnr); | ||||
|      apid1 = apid2 = 0; | ||||
|      dpid1 = dpid2 = 0; | ||||
|      if (apidbuf) { | ||||
|         char *p = strchr(apidbuf, ';'); | ||||
|         if (p) | ||||
|            *p++ = 0; | ||||
|         sscanf(apidbuf, "%d,%d", &apid1, &apid2); | ||||
|         sscanf(apidbuf, "%d ,%d ", &apid1, &apid2); | ||||
|         if (p) | ||||
|            sscanf(p, "%d,%d", &dpid1, &dpid2); | ||||
|            sscanf(p, "%d ,%d ", &dpid1, &dpid2); | ||||
|         delete apidbuf; | ||||
|         } | ||||
|      else | ||||
| @@ -468,7 +472,7 @@ bool cTimer::Parse(const char *s) | ||||
|      strcat(strn0cpy(s2, s, l2 + 1), " \n"); | ||||
|      s = s2; | ||||
|      } | ||||
|   if (8 <= sscanf(s, "%d:%d:%a[^:]:%d:%d:%d:%d:%a[^:\n]:%a[^\n]", &active, &channel, &buffer1, &start, &stop, &priority, &lifetime, &buffer2, &summary)) { | ||||
|   if (8 <= sscanf(s, "%d :%d :%a[^:]:%d :%d :%d :%d :%a[^:\n]:%a[^\n]", &active, &channel, &buffer1, &start, &stop, &priority, &lifetime, &buffer2, &summary)) { | ||||
|      if (summary && !*skipspace(summary)) { | ||||
|         delete summary; | ||||
|         summary = NULL; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user