vdr-1.2.6 off by ones in recording.c show up with gcc4
Commit Message
Hi,
The problem addressed by the second hunk obviously worked by
accident with previous gcc and breaks with gcc4.
cu
Ludwig
Comments
Ludwig Nussel wrote:
> The problem addressed by the second hunk obviously worked by
> accident with previous gcc and breaks with gcc4.
Ok, this was added by the ElchiAIO patch.
cu
Ludwig
===================================================================
@@ -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);