Cleanup FCEU_MakeFName
- silence warnings: replace strncpy with strcpy instead. this should be safe since buffer is strlen+1 which should be enough for a null terminator (from sprintf) - minor cleanup
This commit is contained in:
@@ -90,8 +90,10 @@ char *FCEU_MakeFName(int type, int id1, char *cd1)
|
||||
break;
|
||||
}
|
||||
|
||||
FCEU_printf(" FCEU_MakeFName: %s\n", tmp);
|
||||
|
||||
ret = (char*)malloc(strlen(tmp) * sizeof(char) + 1);
|
||||
strncpy(ret, tmp, strlen(tmp) + 1);
|
||||
strcpy(ret, tmp);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user