mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	Fixed strreplace() to handle NULL strings
This commit is contained in:
		| @@ -3655,6 +3655,8 @@ J | ||||
|  for reporting a possible discrepancy of the primary device number in the LSTD and | ||||
|  PRIM commands | ||||
|  for adding support for EAC3 audio from other sources | ||||
|  for reporting a crash if a pattern timer spawns a timer that uses EPISODE and the | ||||
|  event has no short text | ||||
|  | ||||
| Stefan Verse <Verse@amotronics.de> | ||||
|  for fixing an occasional black screen when switching channels | ||||
|   | ||||
							
								
								
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -9568,3 +9568,7 @@ Video Disk Recorder Revision History | ||||
| - Implemented "Pattern Timers" (see MANUAL, vdr.1 and vdr.5 for details). | ||||
| - Events in the past are no longer marked as having a timer in the Schedules | ||||
|   menu. | ||||
|  | ||||
| 2020-12-29: | ||||
|  | ||||
| - Fixed strreplace() to handle NULL strings (reported by J<>rgen Schneider). | ||||
|   | ||||
							
								
								
									
										4
									
								
								tools.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								tools.c
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
|  * See the main source file 'vdr.c' for copyright information and | ||||
|  * how to reach the author. | ||||
|  * | ||||
|  * $Id: tools.c 5.1 2020/12/26 15:49:01 kls Exp $ | ||||
|  * $Id: tools.c 5.2 2020/12/29 21:40:29 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| #include "tools.h" | ||||
| @@ -151,6 +151,8 @@ char *strreplace(char *s, char c1, char c2) | ||||
|  | ||||
| char *strreplace(char *s, const char *s1, const char *s2) | ||||
| { | ||||
|   if (!s || !s1 || !s2) | ||||
|      return s; | ||||
|   char *p = strstr(s, s1); | ||||
|   if (p) { | ||||
|      int of = p - s; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user