1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Remove extra CR and NL characters from FormatMessage() generated error

messages in the windows VFS.

FossilOrigin-Name: 8332949c28ac72890de82b49bc11f02064b2647d
This commit is contained in:
drh
2011-04-13 23:42:53 +00:00
parent 50990dbb29
commit 5f2dfdbc23
3 changed files with 10 additions and 7 deletions

View File

@@ -385,12 +385,15 @@ static int winLogErrorAtLine(
int iLine /* Source line number where error occurred */
){
char zMsg[500]; /* Human readable error text */
int i; /* Loop counter */
DWORD iErrno = GetLastError(); /* Error code */
zMsg[0] = 0;
getLastErrorMsg(sizeof(zMsg), zMsg);
assert( errcode!=SQLITE_OK );
if( zPath==0 ) zPath = "";
for(i=0; zMsg[i] && zMsg[i]!='\r' && zMsg[i]!='\n'; i++){}
zMsg[i] = 0;
sqlite3_log(errcode,
"os_win.c:%d: (%d) %s(%s) - %s",
iLine, iErrno, zFunc, zPath, zMsg