[haiku-development] Re: Keymap management backend.

  • From: "Michael Pfeiffer" <michael.w.pfeiffer@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 7 Sep 2008 16:34:09 +0200

2008/9/7 Michael Pfeiffer <michael.w.pfeiffer@xxxxxxxxx>:
>> +       default:
>> +               // 2-, 3-, or 4-byte UTF-8 character
>> +               {
>> +                       char *str = new char[size + 1];
>> +                       strncpy(str, &(chars[offset]), size);
>> +                       str[size] = 0;
>> +                       printf("%s", str);
>> +                       delete [] str;
>> +               }
The code in the block could be simplified too:
  printf("%.*s", (int)size, &chars[offset]);

- Michael

Other related posts: