Changeset 924ee11
- Timestamp:
- Mar 29, 2009, 11:35:26 AM (16 years ago)
- Branches:
- owl
- Children:
- 73d8a88
- Parents:
- 5345ea7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r5345ea7 r924ee11 1825 1825 void owl_function_status() 1826 1826 { 1827 char buff[5000]; 1827 char cwdbuff[MAXPATHLEN+1]; 1828 char *buff; 1828 1829 time_t start; 1829 1830 int up, days, hours, minutes; … … 1845 1846 1846 1847 owl_fmtext_append_normal(&fm, " Current Directory: "); 1847 (void) getcwd(buff, MAXPATHLEN); 1848 if(getcwd(cwdbuff, MAXPATHLEN) == NULL) { 1849 owl_fmtext_append_normal(&fm, "<Error in getcwd>"); 1850 } else { 1851 owl_fmtext_append_normal(&fm, cwdbuff); 1852 } 1853 owl_fmtext_append_normal(&fm, "\n"); 1854 1855 buff=owl_sprintf(" Startup Time: %s", ctime(&start)); 1848 1856 owl_fmtext_append_normal(&fm, buff); 1849 owl_fmtext_append_normal(&fm, "\n"); 1850 1851 sprintf(buff, " Startup Time: %s", ctime(&start)); 1852 owl_fmtext_append_normal(&fm, buff); 1857 owl_free(buff); 1853 1858 1854 1859 up=owl_global_get_runtime(&g); … … 1859 1864 minutes=up/60; 1860 1865 up-=minutes*60; 1861 sprintf(buff, " Run Time: %i days %2.2i:%2.2i:%2.2i\n", days, hours, minutes, up); 1866 1867 buff=owl_sprintf(" Run Time: %i days %2.2i:%2.2i:%2.2i\n", days, hours, minutes, up); 1862 1868 owl_fmtext_append_normal(&fm, buff); 1869 owl_free(buff); 1863 1870 1864 1871 owl_fmtext_append_normal(&fm, "\nProtocol Options:\n"); … … 1884 1891 owl_fmtext_append_normal(&fm, "\nMemory Usage:\n"); 1885 1892 owl_fmtext_append_normal(&fm, " Not currently available.\n"); 1886 /*1887 sprintf(buff, "%sMemory Malloced: %i\n", buff, owl_global_get_malloced(&g));1888 sprintf(buff, "%sMemory Freed: %i\n", buff, owl_global_get_freed(&g));1889 sprintf(buff, "%sMemory In Use: %i\n", buff, owl_global_get_meminuse(&g));1890 */1891 1893 1892 1894 owl_fmtext_append_normal(&fm, "\nAIM Status:\n"); … … 1913 1915 { 1914 1916 owl_fmtext fm; 1915 char buff[LINE];1917 char *buff; 1916 1918 1917 1919 owl_fmtext_init_null(&fm); 1918 sprintf(buff,"Terminal Lines: %i\nTerminal Columns: %i\n",1919 owl_global_get_lines(&g),1920 owl_global_get_cols(&g));1920 buff=owl_sprintf("Terminal Lines: %i\nTerminal Columns: %i\n", 1921 owl_global_get_lines(&g), 1922 owl_global_get_cols(&g)); 1921 1923 owl_fmtext_append_normal(&fm, buff); 1924 owl_free(buff); 1922 1925 1923 1926 if (owl_global_get_hascolors(&g)) { 1924 1927 owl_fmtext_append_normal(&fm, "Color: Yes\n"); 1925 sprintf(buff,"Number of color pairs: %i\n", owl_global_get_colorpairs(&g));1928 buff=owl_sprintf("Number of color pairs: %i\n", owl_global_get_colorpairs(&g)); 1926 1929 owl_fmtext_append_normal(&fm, buff); 1927 sprintf(buff, "Can change colors: %s\n", can_change_color() ? "yes" : "no"); 1930 owl_free(buff); 1931 buff=owl_sprintf("Can change colors: %s\n", can_change_color() ? "yes" : "no"); 1928 1932 owl_fmtext_append_normal(&fm, buff); 1933 owl_free(buff); 1929 1934 } else { 1930 1935 owl_fmtext_append_normal(&fm, "Color: No\n"); … … 1942 1947 void owl_function_reply(int type, int enter) 1943 1948 { 1944 char *buff=NULL, * oldbuff;1949 char *buff=NULL, *tmpbuff; 1945 1950 owl_message *m; 1946 1951 owl_filter *f; … … 2026 2031 buff=owl_strdup("zcrypt"); 2027 2032 } else { 2028 buff =owl_strdup("zwrite");2033 buff=owl_strdup("zwrite"); 2029 2034 } 2030 2035 if (strcasecmp(class, "message")) { 2031 buff = owl_sprintf("%s -c %s%s%s", oldbuff=buff, owl_getquoting(class), class, owl_getquoting(class)); 2032 owl_free(oldbuff); 2036 tmpbuff=owl_sprintf("%s -c %s%s%s", buff, owl_getquoting(class), class, owl_getquoting(class)); 2037 owl_free(buff); 2038 buff=tmpbuff; 2033 2039 } 2034 2040 if (strcasecmp(inst, "personal")) { 2035 buff = owl_sprintf("%s -i %s%s%s", oldbuff=buff, owl_getquoting(inst), inst, owl_getquoting(inst)); 2036 owl_free(oldbuff); 2041 tmpbuff=owl_sprintf("%s -i %s%s%s", buff, owl_getquoting(inst), inst, owl_getquoting(inst)); 2042 owl_free(buff); 2043 buff=tmpbuff; 2037 2044 } 2038 2045 if (*to != '\0') { … … 2042 2049 tmp = owl_util_uniq(oldtmp=tmp, cc, "-"); 2043 2050 owl_free(oldtmp); 2044 buff = owl_sprintf("%s -C %s", oldbuff=buff, tmp); 2045 owl_free(oldbuff); 2051 tmpbuff=owl_sprintf("%s -C %s", buff, tmp); 2052 owl_free(buff); 2053 buff=tmpbuff; 2046 2054 } else { 2047 2055 if (owl_global_is_smartstrip(&g)) { … … 2050 2058 owl_free(tmp2); 2051 2059 } 2052 buff = owl_sprintf("%s %s", oldbuff=buff, tmp); 2053 owl_free(oldbuff); 2060 tmpbuff=owl_sprintf("%s %s", buff, tmp); 2061 owl_free(buff); 2062 buff=tmpbuff; 2054 2063 } 2055 2064 owl_free(tmp);
Note: See TracChangeset
for help on using the changeset viewer.