[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Win64 unicode (#332)

Nicolas Cellier notifications at github.com
Wed Jan 2 14:01:58 UTC 2019


nicolas-cellier-aka-nice commented on this pull request.



>      WCHAR buffer[256];
     DWORD memSize;
 
     /* Argh. It seems that the registry key regularly starts
        with \Registry\Machine\ which doesn't work with RegOpenKey below.
        I have no idea why but for now I'll just truncate that part if
        we recognize it... */
-    if (_strnicmp(keyName, "\\registry\\machine\\", 18) == 0) {
-      memcpy(keyName, keyName+18, strlen(keyName)-17);
+    if (_wcsnicmp(keyName, L"\\registry\\machine\\", 18) == 0) {
+      memmove(keyName, keyName+18*sizeof(WCHAR), (wcslen(keyName)-17)*sizeof(WCHAR));

Err: `keyName` is `WCHAR*`, `keyName+18` skips 18 characters, `keyName+18*sizeof(WCHAR)` skips 36 characters!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/332#pullrequestreview-188685921
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20190102/c5b1b9c1/attachment-0001.html>


More information about the Vm-dev mailing list