mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	Renamed the function cString::sprintf(const char *fmt, va_list &ap) to vsprintf()
This commit is contained in:
		| @@ -2593,6 +2593,9 @@ Sundararaj Reel <sundararaj.reel@googlemail.com> | |||||||
|  for reporting a memory leak in cRecordings::ScanVideoDir() in case there are too |  for reporting a memory leak in cRecordings::ScanVideoDir() in case there are too | ||||||
|  many link levels |  many link levels | ||||||
|  for reporting a bug in cListBase::Move() in case From and To are equal |  for reporting a bug in cListBase::Move() in case From and To are equal | ||||||
|  |  for reporting a problem with the function cString::sprintf(const char *fmt, va_list &ap), | ||||||
|  |  that might inadvertently be called with a 'char *' as the second argument on some | ||||||
|  |  compilers and cause a crash | ||||||
|  |  | ||||||
| Ales Jurik <ajurik@quick.cz> | Ales Jurik <ajurik@quick.cz> | ||||||
|  for reporting broken SI data on Czech/Slovak channels after changing the default |  for reporting broken SI data on Czech/Slovak channels after changing the default | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -7096,3 +7096,6 @@ Video Disk Recorder Revision History | |||||||
| - Fixed a possible high CPU load when pausing replay (thanks to Reinhard Nissl). | - Fixed a possible high CPU load when pausing replay (thanks to Reinhard Nissl). | ||||||
| - Fixed character comparisons in cSubtitleObject::DecodeCharacterString() (reported | - Fixed character comparisons in cSubtitleObject::DecodeCharacterString() (reported | ||||||
|   by Reinhard Mantey). |   by Reinhard Mantey). | ||||||
|  | - Renamed the function cString::sprintf(const char *fmt, va_list &ap) to vsprintf(), | ||||||
|  |   because it might inadvertently be called with a 'char *' as the second argument on | ||||||
|  |   some compilers and cause a crash (reported by Sundararaj Reel). | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								svdrp.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								svdrp.c
									
									
									
									
									
								
							| @@ -10,7 +10,7 @@ | |||||||
|  * and interact with the Video Disk Recorder - or write a full featured |  * and interact with the Video Disk Recorder - or write a full featured | ||||||
|  * graphical interface that sits on top of an SVDRP connection. |  * graphical interface that sits on top of an SVDRP connection. | ||||||
|  * |  * | ||||||
|  * $Id: svdrp.c 2.17 2012/04/26 10:36:11 kls Exp $ |  * $Id: svdrp.c 2.18 2012/05/08 11:23:56 kls Exp $ | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "svdrp.h" | #include "svdrp.h" | ||||||
| @@ -432,7 +432,7 @@ void cSVDRP::Reply(int Code, const char *fmt, ...) | |||||||
|      if (Code != 0) { |      if (Code != 0) { | ||||||
|         va_list ap; |         va_list ap; | ||||||
|         va_start(ap, fmt); |         va_start(ap, fmt); | ||||||
|         cString buffer = cString::sprintf(fmt, ap); |         cString buffer = cString::vsprintf(fmt, ap); | ||||||
|         va_end(ap); |         va_end(ap); | ||||||
|         const char *s = buffer; |         const char *s = buffer; | ||||||
|         while (s && *s) { |         while (s && *s) { | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								thread.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								thread.c
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | |||||||
|  * See the main source file 'vdr.c' for copyright information and |  * See the main source file 'vdr.c' for copyright information and | ||||||
|  * how to reach the author. |  * how to reach the author. | ||||||
|  * |  * | ||||||
|  * $Id: thread.c 2.3 2009/04/13 13:50:39 kls Exp $ |  * $Id: thread.c 2.4 2012/05/08 11:15:57 kls Exp $ | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "thread.h" | #include "thread.h" | ||||||
| @@ -239,7 +239,7 @@ void cThread::SetDescription(const char *Description, ...) | |||||||
|   if (Description) { |   if (Description) { | ||||||
|      va_list ap; |      va_list ap; | ||||||
|      va_start(ap, Description); |      va_start(ap, Description); | ||||||
|      description = strdup(cString::sprintf(Description, ap)); |      description = strdup(cString::vsprintf(Description, ap)); | ||||||
|      va_end(ap); |      va_end(ap); | ||||||
|      } |      } | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								tools.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								tools.c
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | |||||||
|  * See the main source file 'vdr.c' for copyright information and |  * See the main source file 'vdr.c' for copyright information and | ||||||
|  * how to reach the author. |  * how to reach the author. | ||||||
|  * |  * | ||||||
|  * $Id: tools.c 2.22 2012/02/18 15:30:35 kls Exp $ |  * $Id: tools.c 2.23 2012/05/08 11:13:13 kls Exp $ | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "tools.h" | #include "tools.h" | ||||||
| @@ -958,7 +958,7 @@ cString cString::sprintf(const char *fmt, ...) | |||||||
|   return cString(buffer, true); |   return cString(buffer, true); | ||||||
| } | } | ||||||
|  |  | ||||||
| cString cString::sprintf(const char *fmt, va_list &ap) | cString cString::vsprintf(const char *fmt, va_list &ap) | ||||||
| { | { | ||||||
|   char *buffer; |   char *buffer; | ||||||
|   if (!fmt || vasprintf(&buffer, fmt, ap) < 0) { |   if (!fmt || vasprintf(&buffer, fmt, ap) < 0) { | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								tools.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								tools.h
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | |||||||
|  * See the main source file 'vdr.c' for copyright information and |  * See the main source file 'vdr.c' for copyright information and | ||||||
|  * how to reach the author. |  * how to reach the author. | ||||||
|  * |  * | ||||||
|  * $Id: tools.h 2.17 2012/04/01 11:36:10 kls Exp $ |  * $Id: tools.h 2.18 2012/05/08 11:11:33 kls Exp $ | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef __TOOLS_H | #ifndef __TOOLS_H | ||||||
| @@ -177,7 +177,7 @@ public: | |||||||
|   cString &operator=(const char *String); |   cString &operator=(const char *String); | ||||||
|   cString &Truncate(int Index); ///< Truncate the string at the given Index (if Index is < 0 it is counted from the end of the string). |   cString &Truncate(int Index); ///< Truncate the string at the given Index (if Index is < 0 it is counted from the end of the string). | ||||||
|   static cString sprintf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); |   static cString sprintf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); | ||||||
|   static cString sprintf(const char *fmt, va_list &ap); |   static cString vsprintf(const char *fmt, va_list &ap); | ||||||
|   }; |   }; | ||||||
|  |  | ||||||
| ssize_t safe_read(int filedes, void *buffer, size_t size); | ssize_t safe_read(int filedes, void *buffer, size_t size); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user