mirror of
https://github.com/mintycube/dmenu.git
synced 2024-10-22 14:05:48 +02:00
Bump to 1e8c5b6.
tab-complete: figure out the size before copying we already need to know the string length since `cursor` needs to be adjusted. so just calculate the length beforehand and use `memcpy` to copy exactly as much as needed (as opposed to `strncpy` which always writes `n` bytes). + fix a regression in the previous commit for tab complete Reported by Santtu Lakkala <inz@inz.fi>, thanks! Ref. https://git.suckless.org/dmenu/commit/528d39b011afb7ef6fd794ba6b74155d4e69bc68.html https://git.suckless.org/dmenu/commit/1e8c5b68f4881bd4ae257c780fd41f129c79f419.html
This commit is contained in:
parent
1bc6ec6fcd
commit
6f9bd28e6b
@ -1,5 +1,5 @@
|
||||
Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this dmenu 5.1 (e35976f,
|
||||
2022-08-08) project has a different take on patching. It uses preprocessor directives to decide
|
||||
Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this dmenu 5.1 (1e8c5b6,
|
||||
2022-09-01) project has a different take on patching. It uses preprocessor directives to decide
|
||||
whether or not to include a patch during build time. Essentially this means that this build, for
|
||||
better or worse, contains both the patched _and_ the original code. The aim being that you can
|
||||
select which patches to include and the build will contain that code and nothing more.
|
||||
|
8
dmenu.c
8
dmenu.c
@ -1337,11 +1337,11 @@ insert:
|
||||
#else
|
||||
if (!sel)
|
||||
return;
|
||||
strncpy(text, sel->text, sizeof text - 1);
|
||||
text[sizeof text - 1] = '\0';
|
||||
cursor = strlen(text);
|
||||
cursor = strnlen(sel->text, sizeof text - 1);
|
||||
memcpy(text, sel->text, cursor);
|
||||
text[cursor] = '\0';
|
||||
match();
|
||||
#endif //
|
||||
#endif // PREFIXCOMPLETION_PATCH
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user