Changeset 3472845 for util.c


Ignore:
Timestamp:
Feb 11, 2011, 5:18:45 PM (10 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
8a97586
Parents:
d4927a7
git-author:
Anders Kaseorg <andersk@mit.edu> (08/27/09 00:56:39)
git-committer:
Anders Kaseorg <andersk@mit.edu> (02/11/11 17:18:45)
Message:
Replace owl_sprintf with g_strdup_printf.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Karl Ramm <kcr@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • util.c

    rd4927a7 r3472845  
    285285
    286286  if (days>0) {
    287     out=owl_sprintf("%i d %2.2i:%2.2li", days, hours, run);
     287    out=g_strdup_printf("%i d %2.2i:%2.2li", days, hours, run);
    288288  } else {
    289     out=owl_sprintf("    %2.2i:%2.2li", hours, run);
     289    out=g_strdup_printf("    %2.2i:%2.2li", hours, run);
    290290  }
    291291  return(out);
    292 }
    293 
    294 /* allocates memory and returns the string or null.
    295  * caller must free the string.
    296  */
    297 char *owl_sprintf(const char *fmt, ...)
    298 {
    299   va_list ap;
    300   char *ret = NULL;
    301   va_start(ap, fmt);
    302   ret = g_strdup_vprintf(fmt, ap);
    303   va_end(ap);
    304   return ret;
    305292}
    306293
     
    468455    return -1; /* resolving the symlink failed, but we already logged this error */
    469456
    470   newfile = owl_sprintf("%s.new", actual_filename);
     457  newfile = g_strdup_printf("%s.new", actual_filename);
    471458  if ((new = fopen(newfile, "w")) == NULL) {
    472459    owl_function_error("Cannot open %s (for writing): %s",
     
    500487
    501488  if (backup) {
    502     backupfile = owl_sprintf("%s.backup", actual_filename);
     489    backupfile = g_strdup_printf("%s.backup", actual_filename);
    503490    unlink(backupfile);
    504491    if (link(actual_filename, backupfile) != 0) {
Note: See TracChangeset for help on using the changeset viewer.