} else {
#endif
*crep_len = 1;
- crep[0] = control_rep((unsigned char)*c);
+ *crep = control_rep((unsigned char)*c);
return crep;
#ifdef NANO_WIDE
* multibyte character and its length. */
char *make_mbchar(int chr, int *chr_mb_len)
{
- assert(chr_mb != NULL && chr_mb_len != NULL);
-
char *chr_mb;
+ assert(chr_mb != NULL && chr_mb_len != NULL);
+
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
chr_mb = charalloc(MB_CUR_MAX);
#endif
*chr_mb_len = 1;
chr_mb = charalloc(1);
- chr_mb[0] = (char)chr;
+ *chr_mb = (char)chr;
#ifdef NANO_WIDE
}
#endif
/* Convert the string str to a valid multibyte string with the same wide
* character values as str. Return the (dynamically allocated)
* multibyte string. */
-char *make_mbstring(char *str)
+char *make_mbstring(const char *str)
{
assert(str != NULL);
- char *str_mb;
-
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
char *chr_mb = charalloc(MB_CUR_MAX);
int chr_mb_len;
- str_mb = charalloc((MB_CUR_MAX * strlen(str)) + 1);
+ char *str_mb = charalloc((MB_CUR_MAX * strlen(str)) + 1);
size_t str_mb_len = 0;
while (*str != '\0') {
char *bad_chr_mb;
int bad_chr_mb_len;
- bad_chr_mb = make_mbchar((unsigned char)chr_mb[0],
+ bad_chr_mb = make_mbchar((unsigned char)*chr_mb,
&bad_chr_mb_len);
for (i = 0; i < bad_chr_mb_len; i++)
return str_mb;
} else
#endif
- return mallocstrcpy(str_mb, str);
+ return mallocstrcpy(NULL, str);
}
#endif
int mb_cur_max(void);
char *make_mbchar(int chr, int *chr_mb_len);
#ifdef ENABLE_NANORC
-char *make_mbstring(char *str);
+char *make_mbstring(const char *str);
#endif
int parse_mbchar(const char *buf, char *chr, bool *bad_chr, size_t
*col);
"David Benbennick",
"Ken Tyler",
"Sven Guckes",
-#ifdef NANO_WIDE
- !ISSET(NO_UTF8) ? "Florian König" :
-#endif
- "Florian König",
+ "Florian König",
"Pauli Virtanen",
"Daniele Medri",
"Clement Laforet",
for (crpos = 0; crpos < CREDIT_LEN + editwinrows / 2; crpos++) {
if (wgetch(edit) != ERR)
break;
+
if (crpos < CREDIT_LEN) {
const char *what = credits[crpos];
size_t start_x;
mvwaddstr(edit, editwinrows - 1 - editwinrows % 2, start_x,
what);
}
+
napms(700);
scroll(edit);
wrefresh(edit);