Changeset 4767 for libcaca


Ignore:
Timestamp:
Feb 13, 2011, 2:12:28 PM (8 years ago)
Author:
Sam Hocevar
Message:

Fix a bug in our Xutf8LookupString() usage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/driver/x11.c

    r4641 r4767  
    522522    {
    523523        KeySym keysym;
     524#if defined X_HAVE_UTF8_STRING
     525        int len;
     526#endif
    524527
    525528        /* Expose event */
     
    603606
    604607#if defined X_HAVE_UTF8_STRING
    605         if(Xutf8LookupString(dp->drv.p->ic, &xevent.xkey, ev->data.key.utf8, 8, NULL, NULL))
     608        len = Xutf8LookupString(dp->drv.p->ic, &xevent.xkey,
     609                                ev->data.key.utf8, 8, NULL, NULL);
     610        ev->data.key.utf8[len] = 0;
     611        if (len)
    606612        {
    607613            ev->data.key.utf32 = caca_utf8_to_utf32(ev->data.key.utf8, NULL);
    608614            if(ev->data.key.utf32 <= 0xff)
    609             {
    610615                ev->data.key.ch = ev->data.key.utf32;
    611             } else {
     616            else
    612617                ev->data.key.ch = 0;
    613             }
    614618            return 1;
    615619        }
Note: See TracChangeset for help on using the changeset viewer.