--- Daodan/src/Daodan.c 2013/03/02 23:46:33 677 +++ Daodan/src/Daodan.c 2013/03/03 04:37:58 681 @@ -555,19 +555,22 @@ FILE *__fastcall DDrPrintWarning(int fil FILE *result; // eax@4 char v6[512]; // [sp+0h] [bp-100h]@1 FILE* UUgError_WarningFile = *_UUgError_WarningFile; - sprintf_s( - v6, 512, - "Error %x reported from File: %s, Line: %d (message follows) \r\n%s", - errornum, - filename, - linenumber, - message); - if ( UUgError_WarningFile - || (UUgError_WarningFile = oni_fopen("debugger.txt", "wb"), UUgError_WarningFile ) ) - { - oni_fprintf(UUgError_WarningFile, "%s\r\n", v6); - oni_fflush(UUgError_WarningFile); + if (filename && message && (strlen(filename)+strlen(message))<420) { + sprintf( + v6, + "Error %x reported from File: %s, Line: %d (message follows) \r\n%s", + errornum, + filename, + linenumber, + message); + + if ( UUgError_WarningFile + || (UUgError_WarningFile = oni_fopen("debugger.txt", "wb"), UUgError_WarningFile ) ) + { + oni_fprintf(UUgError_WarningFile, "%s\r\n", v6); + oni_fflush(UUgError_WarningFile); + } } //oni_fprintf(stdout, v6); //sprintf(&v6, "%s", message);