Changeset 488ebf6


Ignore:
Timestamp:
Mar 29, 2009, 3:48:44 PM (12 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
owl
Children:
c4b45ce
Parents:
19c0c55
Message:
change owl_global_get_runtime_string to return a string to free
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r2b23a36a r488ebf6  
    12501250  FILE *file;
    12511251  time_t now;
    1252   char buff1[LINE], buff2[LINE];
     1252  char buff1[LINE];
     1253  char *buff2;
    12531254  va_list ap;
    12541255  va_start(ap, fmt);
     
    12631264  buff1[strlen(buff1)-1]='\0';
    12641265
    1265   owl_global_get_runtime_string(&g, buff2);
     1266  buff2=owl_global_get_runtime_string(&g);
    12661267 
    12671268  fprintf(file, "[%i -  %s - %s]: ", (int) getpid(), buff1, buff2);
     
    12691270  fprintf(file, "\n");
    12701271  fclose(file);
    1271 
     1272  owl_free(buff2);
     1273 
    12721274  va_end(ap);
    12731275}
  • global.c

    rfa00c5c r488ebf6  
    468468}
    469469
    470 void owl_global_get_runtime_string(owl_global *g, char *buff) {
     470char *owl_global_get_runtime_string(owl_global *g) {
    471471  time_t diff;
    472472
     
    474474
    475475  /* print something nicer later */   
    476   sprintf(buff, "%i seconds", (int) diff);
     476  return(owl_sprintf("%i seconds", (int) diff));
    477477}
    478478
Note: See TracChangeset for help on using the changeset viewer.