Changeset c1d166b


Ignore:
Timestamp:
Feb 11, 2009, 12:20:21 PM (15 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
a0e6082
Parents:
57609b3
git-author:
Nelson Elhage <nelhage@mit.edu> (02/10/09 18:31:58)
git-committer:
Nelson Elhage <nelhage@mit.edu> (02/11/09 12:20:21)
Message:
functions.c: Remove some more sprintf()s

Fix owl_function_show_status and owl_function_show_term() this time.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r57609b3 rc1d166b  
    18491849  owl_fmtext_append_normal(&fm, "\n");
    18501850
    1851   sprintf(buff, "  Startup Time: %s", ctime(&start));
    1852   owl_fmtext_append_normal(&fm, buff);
     1851  owl_fmtext_appendf_normal(&fm, "  Startup Time: %s", ctime(&start));
    18531852
    18541853  up=owl_global_get_runtime(&g);
     
    18591858  minutes=up/60;
    18601859  up-=minutes*60;
    1861   sprintf(buff, "  Run Time: %i days %2.2i:%2.2i:%2.2i\n", days, hours, minutes, up);
    1862   owl_fmtext_append_normal(&fm, buff);
     1860  owl_fmtext_appendf_normal(&fm, "  Run Time: %i days %2.2i:%2.2i:%2.2i\n", days, hours, minutes, up);
    18631861
    18641862  owl_fmtext_append_normal(&fm, "\nProtocol Options:\n");
     
    19051903{
    19061904  owl_fmtext fm;
    1907   char buff[LINE];
    19081905
    19091906  owl_fmtext_init_null(&fm);
    1910   sprintf(buff, "Terminal Lines: %i\nTerminal Columns: %i\n",
     1907  owl_fmtext_appendf_normal(&fm, "Terminal Lines: %i\nTerminal Columns: %i\n",
    19111908          owl_global_get_lines(&g),
    19121909          owl_global_get_cols(&g));
    1913   owl_fmtext_append_normal(&fm, buff);
    19141910
    19151911  if (owl_global_get_hascolors(&g)) {
    19161912    owl_fmtext_append_normal(&fm, "Color: Yes\n");
    1917     sprintf(buff, "Number of color pairs: %i\n", owl_global_get_colorpairs(&g));
    1918     owl_fmtext_append_normal(&fm, buff);
    1919     sprintf(buff, "Can change colors: %s\n", can_change_color() ? "yes" : "no");
    1920     owl_fmtext_append_normal(&fm, buff);
     1913    owl_fmtext_appendf_normal(&fm, "Number of color pairs: %i\n", owl_global_get_colorpairs(&g));
     1914    owl_fmtext_appendf_normal(&fm, "Can change colors: %s\n", can_change_color() ? "yes" : "no");
    19211915  } else {
    19221916    owl_fmtext_append_normal(&fm, "Color: No\n");
Note: See TracChangeset for help on using the changeset viewer.