Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1193)

Unified Diff: WebCore/platform/UUID.cpp

Issue 3389014: Merge 67017 - Fix a problem in createCanonicalUUIDString that causes the last... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/platform/chromium/test_expectations.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/platform/UUID.cpp
===================================================================
--- WebCore/platform/UUID.cpp (revision 67662)
+++ WebCore/platform/UUID.cpp (working copy)
@@ -84,10 +84,11 @@
FILE* fptr = fopen("/proc/sys/kernel/random/uuid", "r");
if (!fptr)
return String();
- char uuidStr[37] = {0};
- if (!fgets(uuidStr, sizeof(uuidStr) - 1, fptr))
+ char uuidStr[37];
+ char* result = fgets(uuidStr, sizeof(uuidStr), fptr);
+ fclose(fptr);
+ if (!result)
return String();
- fclose(fptr);
String canonicalUuidStr = String(uuidStr).lower(); // make it lower.
ASSERT(canonicalUuidStr[uuidVersionIdentifierIndex] == uuidVersionRequired);
return canonicalUuidStr;
« no previous file with comments | « LayoutTests/platform/chromium/test_expectations.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698