diff options
Diffstat (limited to 'src/misc.c')
-rw-r--r-- | src/misc.c | 48 |
1 files changed, 8 insertions, 40 deletions
@@ -1,4 +1,4 @@ -/* Copyright (c) 2008 +/* Copyright (c) 2008, 2009 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Micah Cowan (micah@cowan.name) @@ -57,7 +57,7 @@ register const char *str; register char *cp; if ((cp = malloc(strlen(str) + 1)) == NULL) - Panic(0, strnomem); + Panic(0, "%s", strnomem); else strcpy(cp, str); return cp; @@ -71,7 +71,7 @@ int n; register char *cp; if ((cp = malloc(n + 1)) == NULL) - Panic(0, strnomem); + Panic(0, "%s", strnomem); else { bcopy((char *)str, cp, n); @@ -125,9 +125,10 @@ int y; } void -leftline(str, y) +leftline(str, y, rend) char *str; int y; +struct mchar *rend; { int l, n; struct mchar mchar_dol; @@ -139,7 +140,7 @@ int y; l = n = strlen(str); if (n > flayer->l_width - 1) n = flayer->l_width - 1; - LPutStr(flayer, str, n, &mchar_blank, 0, y); + LPutStr(flayer, str, n, rend ? rend : &mchar_blank, 0, y); if (n != l) LPutChar(flayer, &mchar_dol, n, y); } @@ -608,7 +609,7 @@ char *value; * the string space, we can free our buf now. */ free(buf); -# else /* NEEDSETENV */ +# else /* NEEDPUTENV */ /* * For all sysv-ish systems that link a standard putenv() * the string-space buf is added to the environment and must not @@ -616,7 +617,7 @@ char *value; * We are sorry to say that memory is lost here, when setting * the same variable again and again. */ -# endif /* NEEDSETENV */ +# endif /* NEEDPUTENV */ #else /* USESETENV */ # if HAVE_SETENV_3 setenv(var, value, 1); @@ -651,39 +652,6 @@ int (*outc) __P((int)); return 0; } -# ifdef linux - -/* stupid stupid linux ncurses! It won't to padding with - * zeros but sleeps instead. This breaks CalcCost, of course. - * Also, the ncurses wait functions use a global variable - * to store the current outc function. Oh well... - */ - -int (*save_outc) __P((int)); - -# undef tputs - -void -xtputs(str, affcnt, outc) -char *str; -int affcnt; -int (*outc) __P((int)); -{ - extern int tputs __P((const char *, int, int (*)(int))); - save_outc = outc; - tputs(str, affcnt, outc); -} - -int -_nc_timed_wait(mode, ms, tlp) -int mode, ms, *tlp; -{ - _delay(ms * 10, save_outc); - return 0; -} - -# endif /* linux */ - #endif /* TERMINFO */ |