Index: aim.c
===================================================================
--- aim.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ aim.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -201,5 +201,5 @@
   owl_global_set_doaimevents(&g); /* this should already be on */
   owl_function_makemsg("%s logged in", screenname);
-  buff=owl_sprintf("Logged in to AIM as %s", screenname);
+  buff=g_strdup_printf("Logged in to AIM as %s", screenname);
   owl_function_adminmsg("", buff);
   g_free(buff);
Index: cmd.c
===================================================================
--- cmd.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ cmd.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -147,5 +147,5 @@
   cmd->name = g_strdup(name);
   cmd->cmd_aliased_to = g_strdup(aliased_to);
-  cmd->summary = owl_sprintf("%s%s", OWL_CMD_ALIAS_SUMMARY_PREFIX, aliased_to);
+  cmd->summary = g_strdup_printf("%s%s", OWL_CMD_ALIAS_SUMMARY_PREFIX, aliased_to);
   return(0);
 }
@@ -186,5 +186,5 @@
     } else {
       cmdbuffargs = skiptokens(cmdbuff, 1);
-      newcmd = owl_sprintf("%s %s", cmd->cmd_aliased_to, cmdbuffargs);
+      newcmd = g_strdup_printf("%s %s", cmd->cmd_aliased_to, cmdbuffargs);
       rv = owl_function_command(newcmd);
       g_free(newcmd);
@@ -247,5 +247,5 @@
 char *owl_cmd_describe(const owl_cmd *cmd) {
   if (!cmd || !cmd->name || !cmd->summary) return NULL;
-  return owl_sprintf("%-25s - %s", cmd->name, cmd->summary);
+  return g_strdup_printf("%-25s - %s", cmd->name, cmd->summary);
 }
 
Index: commands.c
===================================================================
--- commands.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ commands.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -1413,5 +1413,5 @@
     return NULL;
   }
-  return owl_sprintf("%d", owl_global_get_rightshift(&g));
+  return g_strdup_printf("%d", owl_global_get_rightshift(&g));
 }
 
Index: functions.c
===================================================================
--- functions.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ functions.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -96,11 +96,11 @@
   owl_fmtext *fm = user_data;
   owl_timer *timer = data;
-  char *str = owl_sprintf("- %s: in %d seconds",
-                          timer->name ? timer->name : "(unnamed)",
-                          (int)(timer->time - time(NULL)));
+  char *str = g_strdup_printf("- %s: in %d seconds",
+                              timer->name ? timer->name : "(unnamed)",
+                              (int)(timer->time - time(NULL)));
   owl_fmtext_append_normal(fm, str);
   g_free(str);
   if (timer->interval) {
-    str = owl_sprintf(", repeat every %d seconds", timer->interval);
+    str = g_strdup_printf(", repeat every %d seconds", timer->interval);
     owl_fmtext_append_normal(fm, str);
     g_free(str);
@@ -133,7 +133,7 @@
     desc = "???";
   }
-  s = owl_sprintf("%-20s - %s%s", name, 
-		  0==owl_style_validate(style)?"":"[INVALID] ",
-		  desc);
+  s = g_strdup_printf("%-20s - %s%s", name,
+		      0 == owl_style_validate(style) ? "" : "[INVALID] ",
+		      desc);
   return s;
 }
@@ -216,5 +216,5 @@
         char *perlquickstart = owl_perlconfig_execute("BarnOwl::Hooks::_get_quickstart()");
         if (perlquickstart) {
-            char *result = owl_sprintf("%s%s", message, perlquickstart);
+            char *result = g_strdup_printf("%s%s", message, perlquickstart);
             owl_function_adminmsg("BarnOwl Quickstart", result);
             g_free(result);
@@ -311,5 +311,5 @@
                                    owl_global_get_msg_history(&g));
   owl_editwin_set_dotsend(e);
-  s = owl_sprintf("----> %s\n", line);
+  s = g_strdup_printf("----> %s\n", line);
   owl_editwin_set_locktext(e, s);
   g_free(s);
@@ -354,5 +354,5 @@
   /* TODO: We probably actually want an owl_aimwrite object like
    * owl_zwrite. */
-  char *line = owl_sprintf("aimwrite %s", to);
+  char *line = g_strdup_printf("aimwrite %s", to);
   owl_function_write_setup("message");
   owl_function_start_edit_win(line,
@@ -438,5 +438,5 @@
   old_msg = g_strdup(owl_zwrite_get_message(z));
 
-  zcrypt = owl_sprintf("%s/zcrypt", owl_get_bindir());
+  zcrypt = g_strdup_printf("%s/zcrypt", owl_get_bindir());
   argv[0] = "zcrypt";
   argv[1] = "-E";
@@ -1991,5 +1991,5 @@
 
   buff = skiptokens(buff, 1);
-  newbuff = owl_sprintf("%s%s", buff, redirect);
+  newbuff = g_strdup_printf("%s%s", buff, redirect);
 
   if (type == OWL_OUTPUT_POPUP) {
@@ -2193,5 +2193,5 @@
     newname=g_strdup(filtername+4);
   } else {
-    newname=owl_sprintf("not-%s", filtername);
+    newname=g_strdup_printf("not-%s", filtername);
   }
 
@@ -2245,5 +2245,5 @@
   }
   tmp = owl_filter_print(f);
-  buff = owl_sprintf("%s: %s", owl_filter_get_name(f), tmp);
+  buff = g_strdup_printf("%s: %s", owl_filter_get_name(f), tmp);
   owl_function_popless_text(buff);
   g_free(buff);
@@ -2305,7 +2305,7 @@
   /* name for the filter */
   if (!instance) {
-    filtname = owl_sprintf("%sclass-%s", related ? "related-" : "", class);
-  } else {
-    filtname = owl_sprintf("%sclass-%s-instance-%s", related ? "related-" : "", class, instance);
+    filtname = g_strdup_printf("%sclass-%s", related ? "related-" : "", class);
+  } else {
+    filtname = g_strdup_printf("%sclass-%s-instance-%s", related ? "related-" : "", class, instance);
   }
   /* downcase it */
@@ -2379,5 +2379,5 @@
   /* name for the filter */
   shortuser = short_zuser(longuser);
-  filtname = owl_sprintf("user-%s", shortuser);
+  filtname = g_strdup_printf("user-%s", shortuser);
   g_free(shortuser);
 
@@ -2425,5 +2425,5 @@
 
   /* name for the filter */
-  filtname=owl_sprintf("aimuser-%s", user);
+  filtname=g_strdup_printf("aimuser-%s", user);
 
   /* if it already exists then go with it.  This lets users override */
@@ -2435,5 +2435,5 @@
   escuser = owl_text_quote(user, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
 
-  argbuff = owl_sprintf(
+  argbuff = g_strdup_printf(
       "( type ^aim$ and ( ( sender ^%1$s$ and recipient ^%2$s$ ) or "
       "( sender ^%2$s$ and recipient ^%1$s$ ) ) )",
@@ -2462,5 +2462,5 @@
 
   /* name for the filter */
-  filtname=owl_sprintf("type-%s", type);
+  filtname=g_strdup_printf("type-%s", type);
 
   /* if it already exists then go with it.  This lets users override */
@@ -2521,5 +2521,5 @@
   ccs = owl_message_get_attribute_value(m, "zephyr_ccs");
 
-  filtname = owl_sprintf("conversation-%s", ccs);
+  filtname = g_strdup_printf("conversation-%s", ccs);
   owl_text_tr(filtname, ' ', '-');
 
@@ -2763,6 +2763,6 @@
 
   for(i = 8; i < COLORS; ++i) {
-    char* str1 = owl_sprintf("%4i:     ",i);
-    char* str2 = owl_sprintf("%i\n",i);
+    char* str1 = g_strdup_printf("%4i:     ",i);
+    char* str2 = g_strdup_printf("%i\n",i);
     owl_fmtext_append_normal(&fm,str1);
     owl_fmtext_append_normal_color(&fm, str2, i, OWL_COLOR_DEFAULT);
@@ -3392,5 +3392,5 @@
   date[strlen(date)-1]='\0';
 
-  buff = owl_sprintf("%s %s", date, string);
+  buff = g_strdup_printf("%s %s", date, string);
 
   owl_errqueue_append_err(owl_global_get_errqueue(&g), buff);
Index: global.c
===================================================================
--- global.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ global.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -94,5 +94,5 @@
   g->confdir = NULL;
   g->startupfile = NULL;
-  cd = owl_sprintf("%s/%s", g->homedir, OWL_CONFIG_DIR);
+  cd = g_strdup_printf("%s/%s", g->homedir, OWL_CONFIG_DIR);
   owl_global_set_confdir(g, cd);
   g_free(cd);
@@ -382,5 +382,5 @@
   g->confdir = g_strdup(cd);
   g_free(g->startupfile);
-  g->startupfile = owl_sprintf("%s/startup", cd);
+  g->startupfile = g_strdup_printf("%s/startup", cd);
 }
 
@@ -965,5 +965,5 @@
     g->debug_file = NULL;
 
-    path = owl_sprintf("%s.%d", filename, getpid());
+    path = g_strdup_printf("%s.%d", filename, getpid());
     fd = open(path, O_CREAT|O_WRONLY|O_EXCL, 0600);
     g_free(path);
Index: keymap.c
===================================================================
--- keymap.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ keymap.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -85,5 +85,5 @@
 {
   if (!km || !km->name || !km->desc) return NULL;
-  return owl_sprintf("%-15s - %s", km->name, km->desc);
+  return g_strdup_printf("%-15s - %s", km->name, km->desc);
 }
 
Index: logging.c
===================================================================
--- logging.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ logging.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -149,5 +149,5 @@
     to = short_zuser(owl_message_get_recipient(m));
   } else if (owl_message_is_type_jabber(m)) {
-    to = owl_sprintf("jabber:%s", owl_message_get_recipient(m));
+    to = g_strdup_printf("jabber:%s", owl_message_get_recipient(m));
     owl_text_tr(to, '/', '_');
   } else if (owl_message_is_type_aim(m)) {
@@ -155,5 +155,5 @@
     temp = owl_aim_normalize_screenname(owl_message_get_recipient(m));
     temp2 = g_utf8_strdown(temp,-1);
-    to = owl_sprintf("aim:%s", temp2);
+    to = g_strdup_printf("aim:%s", temp2);
     g_free(temp2);
     g_free(temp);
@@ -269,5 +269,5 @@
     temp = owl_aim_normalize_screenname(owl_message_get_sender(m));
     normalto = g_utf8_strdown(temp, -1);
-    from=frombuff=owl_sprintf("aim:%s", normalto);
+    from=frombuff=g_strdup_printf("aim:%s", normalto);
     g_free(normalto);
     g_free(temp);
@@ -276,7 +276,7 @@
   } else if (owl_message_is_type_jabber(m)) {
     if (personal) {
-      from=frombuff=owl_sprintf("jabber:%s",owl_message_get_sender(m));
-    } else {
-      from=frombuff=owl_sprintf("jabber:%s",owl_message_get_recipient(m));
+      from=frombuff=g_strdup_printf("jabber:%s",owl_message_get_sender(m));
+    } else {
+      from=frombuff=g_strdup_printf("jabber:%s",owl_message_get_recipient(m));
     }
   } else {
Index: message.c
===================================================================
--- message.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ message.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -127,7 +127,7 @@
   for (i=0; i<j; i++) {
     p=owl_list_get_element(&(m->attributes), i);
-    buff=owl_sprintf("  %-15.15s: %-35.35s\n", owl_pair_get_key(p), owl_pair_get_value(p));
+    buff=g_strdup_printf("  %-15.15s: %-35.35s\n", owl_pair_get_key(p), owl_pair_get_value(p));
     if(buff == NULL) {
-      buff=owl_sprintf("  %-15.15s: %-35.35s\n", owl_pair_get_key(p), "<error>");
+      buff=g_strdup_printf("  %-15.15s: %-35.35s\n", owl_pair_get_key(p), "<error>");
       if(buff == NULL)
         buff=g_strdup("   <error>\n");
@@ -888,5 +888,5 @@
     char *zcrypt;
 
-    zcrypt = owl_sprintf("%s/zcrypt", owl_get_bindir());
+    zcrypt = g_strdup_printf("%s/zcrypt", owl_get_bindir());
 
     rv = call_filter(zcrypt, argv, owl_message_get_body(m), &out, &status);
Index: owl.c
===================================================================
--- owl.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ owl.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -434,5 +434,5 @@
   }
 
-  err = owl_sprintf("[stderr]\n%s", buf);
+  err = g_strdup_printf("[stderr]\n%s", buf);
 
   owl_function_log_err(err);
Index: perlconfig.c
===================================================================
--- perlconfig.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ perlconfig.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -150,5 +150,5 @@
   utype = g_strdup(type);
   utype[0] = toupper(type[0]);
-  blessas = owl_sprintf("BarnOwl::Message::%s", utype);
+  blessas = g_strdup_printf("BarnOwl::Message::%s", utype);
 
   hr = newRV_noinc((SV*)h);
@@ -240,5 +240,5 @@
     n->z_multinotice = zstr("[zephyr created from perl]");
     n->z_num_other_fields = 0;
-    n->z_message = owl_sprintf("%s%c%s", owl_message_get_zsig(m), '\0', owl_message_get_body(m));
+    n->z_message = g_strdup_printf("%s%c%s", owl_message_get_zsig(m), '\0', owl_message_get_body(m));
     n->z_message_len = strlen(owl_message_get_zsig(m)) + strlen(owl_message_get_body(m)) + 1;
   }
@@ -404,5 +404,5 @@
   /* Add the system lib path to @INC */
   inc = get_av("INC", 0);
-  path = owl_sprintf("%s/lib", owl_get_datadir());
+  path = g_strdup_printf("%s/lib", owl_get_datadir());
   av_unshift(inc, 1);
   av_store(inc, 0, owl_new_sv(path));
Index: util.c
===================================================================
--- util.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ util.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -285,22 +285,9 @@
 
   if (days>0) {
-    out=owl_sprintf("%i d %2.2i:%2.2li", days, hours, run);
+    out=g_strdup_printf("%i d %2.2i:%2.2li", days, hours, run);
   } else {
-    out=owl_sprintf("    %2.2i:%2.2li", hours, run);
+    out=g_strdup_printf("    %2.2i:%2.2li", hours, run);
   }
   return(out);
-}
-
-/* allocates memory and returns the string or null.
- * caller must free the string. 
- */
-char *owl_sprintf(const char *fmt, ...)
-{
-  va_list ap;
-  char *ret = NULL;
-  va_start(ap, fmt);
-  ret = g_strdup_vprintf(fmt, ap);
-  va_end(ap);
-  return ret;
 }
 
@@ -468,5 +455,5 @@
     return -1; /* resolving the symlink failed, but we already logged this error */
 
-  newfile = owl_sprintf("%s.new", actual_filename);
+  newfile = g_strdup_printf("%s.new", actual_filename);
   if ((new = fopen(newfile, "w")) == NULL) {
     owl_function_error("Cannot open %s (for writing): %s",
@@ -500,5 +487,5 @@
 
   if (backup) {
-    backupfile = owl_sprintf("%s.backup", actual_filename);
+    backupfile = g_strdup_printf("%s.backup", actual_filename);
     unlink(backupfile);
     if (link(actual_filename, backupfile) != 0) {
Index: zephyr.c
===================================================================
--- zephyr.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ zephyr.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -25,5 +25,5 @@
     return g_strdup(input);
   else
-    return owl_sprintf("%s/%s", owl_global_get_homedir(&g), name);
+    return g_strdup_printf("%s/%s", owl_global_get_homedir(&g), name);
 }
 
@@ -588,5 +588,5 @@
     field4 = owl_zephyr_get_field(n, 4);
 
-    msg = owl_sprintf("%s service on %s %s\n%s", n->z_opcode, n->z_class_inst, field3, field4);
+    msg = g_strdup_printf("%s service on %s %s\n%s", n->z_opcode, n->z_class_inst, field3, field4);
     g_free(field3);
     g_free(field4);
@@ -606,5 +606,5 @@
     field5 = owl_zephyr_get_field(n, 5);
     
-    msg = owl_sprintf("New transaction [%s] entered in %s\nFrom: %s (%s)\nSubject: %s", field1, field2, field3, field5, field4);
+    msg = g_strdup_printf("New transaction [%s] entered in %s\nFrom: %s (%s)\nSubject: %s", field1, field2, field3, field5, field4);
     g_free(field1);
     g_free(field2);
@@ -622,5 +622,5 @@
     field1 = owl_zephyr_get_field(n, 1);
     
-    msg = owl_sprintf("MOIRA %s on %s: %s", n->z_class_inst, owl_message_get_hostname(m), field1);
+    msg = g_strdup_printf("MOIRA %s on %s: %s", n->z_class_inst, owl_message_get_hostname(m), field1);
     g_free(field1);
     if (msg) {
@@ -882,7 +882,7 @@
   myuser=short_zuser(to);
   if (!strcasecmp(owl_message_get_instance(m), "personal")) {
-    tmpbuff = owl_sprintf("zwrite %s", myuser);
+    tmpbuff = g_strdup_printf("zwrite %s", myuser);
   } else {
-    tmpbuff = owl_sprintf("zwrite -i %s %s", owl_message_get_instance(m), myuser);
+    tmpbuff = g_strdup_printf("zwrite -i %s %s", owl_message_get_instance(m), myuser);
   }
   g_free(myuser);
@@ -927,15 +927,15 @@
   ret = ZLocateUser(zstr(user), &numlocs, auth ? ZAUTH : ZNOAUTH);
   if (ret != ZERR_NONE)
-    return owl_sprintf("Error locating user %s: %s\n",
-		       user, error_message(ret));
+    return g_strdup_printf("Error locating user %s: %s\n",
+			   user, error_message(ret));
 
   myuser = short_zuser(user);
   if (numlocs == 0) {
-    result = owl_sprintf("%s: Hidden or not logged in\n", myuser);
+    result = g_strdup_printf("%s: Hidden or not logged in\n", myuser);
   } else {
     result = g_strdup("");
     for (; numlocs; numlocs--) {
       ZGetLocations(&locations, &one);
-      p = owl_sprintf("%s%s: %s\t%s\t%s\n",
+      p = g_strdup_printf("%s%s: %s\t%s\t%s\n",
 			  result, myuser,
 			  locations.host ? locations.host : "?",
@@ -1017,5 +1017,5 @@
 char *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip)
 {
-  return owl_sprintf("%s,%s,%s\n", class, inst, !strcmp(recip, "") ? "*" : recip);
+  return g_strdup_printf("%s,%s,%s\n", class, inst, !strcmp(recip, "") ? "*" : recip);
 }
 
@@ -1146,8 +1146,8 @@
     } else {
       /* g_string_append_printf would be backwards. */
-      char *tmp = owl_sprintf("<%s,%s,%s>\n",
-                              sub.zsub_class,
-                              sub.zsub_classinst,
-                              sub.zsub_recipient);
+      char *tmp = g_strdup_printf("<%s,%s,%s>\n",
+                                  sub.zsub_class,
+                                  sub.zsub_classinst,
+                                  sub.zsub_recipient);
       g_string_prepend(buf, tmp);
       g_free(tmp);
@@ -1203,5 +1203,5 @@
     return(g_strdup(in));
   }
-  return(owl_sprintf("%s@%s", in, owl_zephyr_get_realm()));
+  return(g_strdup_printf("%s@%s", in, owl_zephyr_get_realm()));
 }
 
Index: zwrite.c
===================================================================
--- zwrite.c	(revision d4927a70549407fe7f56b4ae1d3949663a370205)
+++ zwrite.c	(revision 3472845ecdabe9cd1549dd2b2355ca745059ea36)
@@ -176,5 +176,5 @@
   for (i=0; i<j; i++) {
     if (strcmp(z->realm, "")) {
-      to = owl_sprintf("%s@%s", (const char *) owl_list_get_element(&(z->recips), i), z->realm);
+      to = g_strdup_printf("%s@%s", (const char *) owl_list_get_element(&(z->recips), i), z->realm);
     } else {
       to = g_strdup(owl_list_get_element(&(z->recips), i));
@@ -207,7 +207,7 @@
       tmp = toline;
       if (strcmp(z->realm, "")) {
-        toline = owl_sprintf( "%s%s@%s ", toline, (const char *) owl_list_get_element(&(z->recips), i), z->realm);
+        toline = g_strdup_printf( "%s%s@%s ", toline, (const char *) owl_list_get_element(&(z->recips), i), z->realm);
       } else {
-        toline = owl_sprintf( "%s%s ", toline, (const char *) owl_list_get_element(&(z->recips), i));
+        toline = g_strdup_printf( "%s%s ", toline, (const char *) owl_list_get_element(&(z->recips), i));
       }
       g_free(tmp);
@@ -216,5 +216,5 @@
     tmp = owl_validate_utf8(msg);
     tmp2 = owl_text_expand_tabs(tmp);
-    z->message=owl_sprintf("%s\n%s", toline, tmp2);
+    z->message=g_strdup_printf("%s\n%s", toline, tmp2);
     g_free(toline);
     g_free(tmp);
@@ -250,5 +250,5 @@
     for (i=0; i<j; i++) {
       if (strcmp(z->realm, "")) {
-        to = owl_sprintf("%s@%s", (const char *) owl_list_get_element(&(z->recips), i), z->realm);
+        to = g_strdup_printf("%s@%s", (const char *) owl_list_get_element(&(z->recips), i), z->realm);
       } else {
         to = g_strdup( owl_list_get_element(&(z->recips), i));
@@ -262,5 +262,5 @@
     }
   } else {
-    to = owl_sprintf( "@%s", z->realm);
+    to = g_strdup_printf( "@%s", z->realm);
     ret = send_zephyr(z->opcode, z->zsig, z->class, z->inst, to, z->message);
   }
