From 59d398a1ae2ea9d17dd27a8a6e7a47b4f02170f2 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Mon, 23 Nov 2009 00:34:44 +0000 Subject: [PATCH] DiskProbe: * The is_valid_utf8(..) is supposed to accept a terminating null byte but was instead looking for a null byte as the first byte. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34191 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/diskprobe/DataView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/diskprobe/DataView.cpp b/src/apps/diskprobe/DataView.cpp index 0e9ee4e30a..bbedd97afe 100644 --- a/src/apps/diskprobe/DataView.cpp +++ b/src/apps/diskprobe/DataView.cpp @@ -40,7 +40,7 @@ is_valid_utf8(uint8 *data, size_t size) { for (size_t i = 0; i < size; i++) { // accept a terminating null byte - if (i == size - 1 && data[0] == '\0') + if (i == size - 1 && data[i] == '\0') return true; if ((data[i] & 0x80) == 0) {