mirror of https://github.com/0intro/conterm
yet more length fiddling
This commit is contained in:
parent
a984a8b22b
commit
602ec6770c
|
@ -626,10 +626,10 @@ clipread(void)
|
||||||
fprint(2, "apple pasteboard CopyItem failed - Error %d\n", err);
|
fprint(2, "apple pasteboard CopyItem failed - Error %d\n", err);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
CFIndex length = CFDataGetLength(cfdata)/sizeof(Rune);
|
CFIndex length = CFDataGetLength(cfdata);
|
||||||
if (length > sizeof rsnarf) length = sizeof rsnarf;
|
if (length > sizeof rsnarf) length = sizeof rsnarf;
|
||||||
CFDataGetBytes(cfdata, CFRangeMake(0, length*sizeof(Rune)), (uint8_t *)rsnarf);
|
CFDataGetBytes(cfdata, CFRangeMake(0, length), (uint8_t *)rsnarf);
|
||||||
snprint(snarf, sizeof snarf, "%.*S", length, rsnarf);
|
snprint(snarf, sizeof snarf, "%.*S", length/sizeof(Rune), rsnarf);
|
||||||
char *s = snarf;
|
char *s = snarf;
|
||||||
while (*s) {
|
while (*s) {
|
||||||
if (*s == '\r') *s = '\n';
|
if (*s == '\r') *s = '\n';
|
||||||
|
|
Loading…
Reference in New Issue