Browse Source

Merge commit 'dd4c063' into bfgminer-3.5.x

Luke Dashjr 12 years ago
parent
commit
441c018f8f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      util.c

+ 6 - 0
util.c

@@ -2607,7 +2607,13 @@ const char *bfg_strerror(int e, enum bfg_strerror_type type)
 			if (*msg)
 				LocalFree(*msg);
 			if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 0, e, 0, (LPSTR)msg, 0, 0))
+			{
+				LPSTR msgp = *msg;
+				size_t n = strlen(msgp);
+				while (isCspace(msgp[--n]))
+					msgp[n] = '\0';
 				return *msg;
+			}
 			*msg = NULL;
 			
 			break;