mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 09:02:13 +02:00
Adjust some conditions.
This commit is contained in:
parent
72064de9fe
commit
a26a387545
1 changed files with 4 additions and 4 deletions
|
|
@ -48,7 +48,7 @@ int string_advance(char const **str, int policy)
|
||||||
int string_policy(const char *str)
|
int string_policy(const char *str)
|
||||||
{
|
{
|
||||||
if (is_utf8()) {
|
if (is_utf8()) {
|
||||||
if (!str || g_utf8_validate(str, -1, NULL)) {
|
if (str == NULL || g_utf8_validate(str, -1, NULL)) {
|
||||||
/* No string provided or valid UTF-8 string: treat as UTF-8: */
|
/* No string provided or valid UTF-8 string: treat as UTF-8: */
|
||||||
return TREAT_STRING_AS_UTF8;
|
return TREAT_STRING_AS_UTF8;
|
||||||
}
|
}
|
||||||
|
|
@ -98,8 +98,8 @@ int string_chars_for_width(const char *str, int policy, unsigned int n, unsigned
|
||||||
g_return_val_if_fail(str != NULL, -1);
|
g_return_val_if_fail(str != NULL, -1);
|
||||||
|
|
||||||
/* Handle the dummy case where n is 0: */
|
/* Handle the dummy case where n is 0: */
|
||||||
if (!n) {
|
if (n == 0) {
|
||||||
if (bytes) {
|
if (bytes != NULL) {
|
||||||
*bytes = 0;
|
*bytes = 0;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -128,7 +128,7 @@ int string_chars_for_width(const char *str, int policy, unsigned int n, unsigned
|
||||||
* columns, which is less than or equal to n. */
|
* columns, which is less than or equal to n. */
|
||||||
|
|
||||||
/* Optionally provide the equivalent amount of bytes: */
|
/* Optionally provide the equivalent amount of bytes: */
|
||||||
if (bytes) {
|
if (bytes != NULL) {
|
||||||
*bytes = c - str;
|
*bytes = c - str;
|
||||||
}
|
}
|
||||||
return char_count;
|
return char_count;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue