Changeset 3472845 for zephyr.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
  • zephyr.c

    rd4927a7 r3472845  
    2525    return g_strdup(input);
    2626  else
    27     return owl_sprintf("%s/%s", owl_global_get_homedir(&g), name);
     27    return g_strdup_printf("%s/%s", owl_global_get_homedir(&g), name);
    2828}
    2929
     
    588588    field4 = owl_zephyr_get_field(n, 4);
    589589
    590     msg = owl_sprintf("%s service on %s %s\n%s", n->z_opcode, n->z_class_inst, field3, field4);
     590    msg = g_strdup_printf("%s service on %s %s\n%s", n->z_opcode, n->z_class_inst, field3, field4);
    591591    g_free(field3);
    592592    g_free(field4);
     
    606606    field5 = owl_zephyr_get_field(n, 5);
    607607   
    608     msg = owl_sprintf("New transaction [%s] entered in %s\nFrom: %s (%s)\nSubject: %s", field1, field2, field3, field5, field4);
     608    msg = g_strdup_printf("New transaction [%s] entered in %s\nFrom: %s (%s)\nSubject: %s", field1, field2, field3, field5, field4);
    609609    g_free(field1);
    610610    g_free(field2);
     
    622622    field1 = owl_zephyr_get_field(n, 1);
    623623   
    624     msg = owl_sprintf("MOIRA %s on %s: %s", n->z_class_inst, owl_message_get_hostname(m), field1);
     624    msg = g_strdup_printf("MOIRA %s on %s: %s", n->z_class_inst, owl_message_get_hostname(m), field1);
    625625    g_free(field1);
    626626    if (msg) {
     
    882882  myuser=short_zuser(to);
    883883  if (!strcasecmp(owl_message_get_instance(m), "personal")) {
    884     tmpbuff = owl_sprintf("zwrite %s", myuser);
     884    tmpbuff = g_strdup_printf("zwrite %s", myuser);
    885885  } else {
    886     tmpbuff = owl_sprintf("zwrite -i %s %s", owl_message_get_instance(m), myuser);
     886    tmpbuff = g_strdup_printf("zwrite -i %s %s", owl_message_get_instance(m), myuser);
    887887  }
    888888  g_free(myuser);
     
    927927  ret = ZLocateUser(zstr(user), &numlocs, auth ? ZAUTH : ZNOAUTH);
    928928  if (ret != ZERR_NONE)
    929     return owl_sprintf("Error locating user %s: %s\n",
    930                        user, error_message(ret));
     929    return g_strdup_printf("Error locating user %s: %s\n",
     930                           user, error_message(ret));
    931931
    932932  myuser = short_zuser(user);
    933933  if (numlocs == 0) {
    934     result = owl_sprintf("%s: Hidden or not logged in\n", myuser);
     934    result = g_strdup_printf("%s: Hidden or not logged in\n", myuser);
    935935  } else {
    936936    result = g_strdup("");
    937937    for (; numlocs; numlocs--) {
    938938      ZGetLocations(&locations, &one);
    939       p = owl_sprintf("%s%s: %s\t%s\t%s\n",
     939      p = g_strdup_printf("%s%s: %s\t%s\t%s\n",
    940940                          result, myuser,
    941941                          locations.host ? locations.host : "?",
     
    10171017char *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip)
    10181018{
    1019   return owl_sprintf("%s,%s,%s\n", class, inst, !strcmp(recip, "") ? "*" : recip);
     1019  return g_strdup_printf("%s,%s,%s\n", class, inst, !strcmp(recip, "") ? "*" : recip);
    10201020}
    10211021
     
    11461146    } else {
    11471147      /* g_string_append_printf would be backwards. */
    1148       char *tmp = owl_sprintf("<%s,%s,%s>\n",
    1149                               sub.zsub_class,
    1150                               sub.zsub_classinst,
    1151                               sub.zsub_recipient);
     1148      char *tmp = g_strdup_printf("<%s,%s,%s>\n",
     1149                                  sub.zsub_class,
     1150                                  sub.zsub_classinst,
     1151                                  sub.zsub_recipient);
    11521152      g_string_prepend(buf, tmp);
    11531153      g_free(tmp);
     
    12031203    return(g_strdup(in));
    12041204  }
    1205   return(owl_sprintf("%s@%s", in, owl_zephyr_get_realm()));
     1205  return(g_strdup_printf("%s@%s", in, owl_zephyr_get_realm()));
    12061206}
    12071207
Note: See TracChangeset for help on using the changeset viewer.