[Webkit-unassigned] [Bug 56761] KeyboardEvent keyIdentifier is not propagated to plugins by Chromium

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 12 15:03:45 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=56761





--- Comment #3 from David Levin <levin at chromium.org>  2011-04-12 15:03:45 PST ---
(From update of attachment 86613)
View in context: https://bugs.webkit.org/attachment.cgi?id=86613&action=review

> Source/WebKit/chromium/src/WebInputEventConversion.cpp:339
> +            sizeof(keyIdentifier) - 1);

I dislike strncpy. It does weird things. (Why fill in all those 0's?)

What about memcpy?
   memcpy(keyIdentifier, event.keyIdentifier().ascii().data(), std::min(sizeof(keyIdentifier) - 1, event.keyIdentifier().ascii().length());
   keyIdentifier[event.keyIdentifier().ascii().length()] = '\0';

(Of course, you may want to put event.keyIdentifier().ascii() in a local and possible length as well, so I guess that makes it slightly longer.)

What do you think?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list