]> andersk Git - moira.git/commitdiff
cast result of strlen to (int) so that "COLS - strlen(buf)" will be an
authordanw <danw>
Fri, 30 Apr 1999 17:44:59 +0000 (17:44 +0000)
committerdanw <danw>
Fri, 30 Apr 1999 17:44:59 +0000 (17:44 +0000)
int instead of being "promoted" to an unsigned int, so that "COLS -
strlen(buf) > 0" is actually a meaningful test. Noticed by Irix n32
cc. Fixes a bug which has presumably been in the moira client display
code ever since it was written.

We hates the Kernighan. We hates him forever.

clients/mailmaint/mailmaint.c
clients/moira/menu.c

index 4561577e8c50bddcca79203ed54c8f6ad2ab530a..274ba9f55c3fec52995f00ae09aeb88851e51823 100644 (file)
@@ -755,7 +755,7 @@ void highlight(MENU *menu)
 /****************************************************/
 void title(char *buff)
 {
-  move(0, MAX(0, (COLS - strlen(buff)) >> 1));
+  move(0, MAX(0, (COLS - (int)strlen(buff)) >> 1));
   standout();
   addstr(buff);
   refresh();
@@ -765,7 +765,7 @@ void title(char *buff)
 /****************************************************/
 void center_text(int row, char *buff)
 {
-  move(row, MAX(0, (COLS - strlen(buff)) >> 1));
+  move(row, MAX(0, (COLS - (int)strlen(buff)) >> 1));
   addstr(buff);
   refresh();
 }
index ef5e5c1aea246fac0dd644b7090cb8904f0f168b..ba226824113a327a4457efc18da6e2fb7c00399a 100644 (file)
@@ -245,7 +245,7 @@ int Do_menu(Menu *m, int margc, char *margv[])
       /* Now print the title and the menu */
       wclear(my_ms->ms_screen);
       wrefresh(my_ms->ms_screen);
-      wmove(my_ms->ms_title, 0, MAX(0, (COLS - strlen(m->m_title)) >> 1));
+      wmove(my_ms->ms_title, 0, MAX(0, (COLS - (int)strlen(m->m_title)) >> 1));
       wstandout(my_ms->ms_title);
       waddstr(my_ms->ms_title, m->m_title);
       wstandend(my_ms->ms_title);
This page took 0.047193 seconds and 5 git commands to generate.