From patchwork Sat Aug 6 14:30:35 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ludwig Nussel X-Patchwork-Id: 11965 Received: from ns.suse.de ([195.135.220.2] helo=mx1.suse.de) by www.linuxtv.org with esmtp (Exim 4.34) id 1E1Ph6-0001WK-Uq for vdr@linuxtv.org; Sat, 06 Aug 2005 16:30:37 +0200 Received: from Relay2.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 2D45FEE09 for ; Sat, 6 Aug 2005 16:30:35 +0200 (CEST) Date: Sat, 6 Aug 2005 16:30:35 +0200 From: Ludwig Nussel To: vdr@linuxtv.org Message-ID: <20050806143034.GA10801@suse.de> Mail-Followup-To: vdr@linuxtv.org Mime-Version: 1.0 Content-Disposition: inline X-Operating-System: SuSE Linux 9.3 (i586) X-Accept-Language: de en X-PGP-Fingerprint: 2987 6870 60BA 3158 F587 88C5 2394 431A FF81 35CE User-Agent: Mutt/1.5.9i Subject: [vdr] [PATCH] vdr-1.2.6 off by ones in recording.c show up with gcc4 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2005 14:30:37 -0000 Status: O X-Status: X-Keywords: X-UID: 3954 Hi, The problem addressed by the second hunk obviously worked by accident with previous gcc and breaks with gcc4. cu Ludwig Index: vdr-1.2.6/recording.c =================================================================== --- vdr-1.2.6.orig/recording.c +++ vdr-1.2.6/recording.c @@ -512,7 +512,7 @@ const char *cRecording::Title(char Delim last = -1; index = NULL; char filename[199]=""; - sprintf(filename, "%s", FileName()); + snprintf(filename, sizeof(filename), "%s", FileName()); if (filename) { fileName = MALLOC(char, strlen(filename) + strlen(INDEXFILESUFFIX) + 1); if (fileName) { @@ -548,8 +548,8 @@ const char *cRecording::Title(char Delim } } } - char RecDate[5]=""; - char RecTime[5]=""; + char RecDate[6]=""; + char RecTime[6]=""; char DummyDelimiter = ' '; sprintf(RecDate,"%02d.%02d", t->tm_mday, t->tm_mon + 1); sprintf(RecTime,"%02d:%02d", t->tm_hour, t->tm_min);