diff --git a/smartmontools/ChangeLog b/smartmontools/ChangeLog
index c00bc14045666c6dc503bc5f9dbc16b412ad281b..7ae4f9b8a7fd8a0c34448d09c20bec759822d604 100644
--- a/smartmontools/ChangeLog
+++ b/smartmontools/ChangeLog
@@ -1,5 +1,9 @@
 $Id$
 
+2020-10-15  Christian Franke  <franke@computer.org>
+
+	os_win32.cpp: Fix removal of trailing blanks.
+
 2020-10-09  Christian Franke  <franke@computer.org>
 
 	scsiprint.cpp: Don't print 'Accumulated power on time' if no
diff --git a/smartmontools/os_win32.cpp b/smartmontools/os_win32.cpp
index c83fd6bb5b20eed206a0ef9bdb1cbc6d71ac2eb3..63e5ace6c6d82c4ca84a2a1c1329f9f7ccd1cfeb 100644
--- a/smartmontools/os_win32.cpp
+++ b/smartmontools/os_win32.cpp
@@ -1081,7 +1081,8 @@ static int get_identify_from_device_property(HANDLE hdevice, ata_identify_device
   }
 
   if (data.desc.ProductIdOffset) {
-    while (i > 1 && model[i-2] == ' ') // Keep last blank from VendorId
+    // Keep only first trailing blank after VendorId
+    while (i > 0 && model[i-1] == ' ' && (i < 2 || model[i-2] == ' '))
       i--;
     // Ignore VendorId "ATA"
     if (i <= 4 && !strncmp(model, "ATA", 3) && (i == 3 || model[3] == ' '))