Changeset 36486be
- Timestamp:
- Aug 22, 2009, 12:50:08 AM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 24ccc01
- Parents:
- 303a9e1
- git-author:
- Anders Kaseorg <andersk@mit.edu> (08/22/09 00:47:21)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (08/22/09 00:50:08)
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
aim.c
r2646676 r36486be 943 943 944 944 if (modname) { 945 if (!(filename = owl_malloc(strlen(priv->aimbinarypath)+1+strlen(modname)+4+1))) { 946 /* perror("memrequest: malloc"); */ 947 return -1; 948 } 949 sprintf(filename, "%s/%s.ocm", priv->aimbinarypath, modname); 945 filename = owl_sprintf("%s/%s.ocm", priv->aimbinarypath, modname); 950 946 } else { 951 if (!(filename = owl_malloc(strlen(priv->aimbinarypath)+1+strlen(defaultmod)+1))) { 952 /* perror("memrequest: malloc"); */ 953 return -1; 954 } 955 sprintf(filename, "%s/%s", priv->aimbinarypath, defaultmod); 947 filename = owl_sprintf("%s/%s", priv->aimbinarypath, defaultmod); 956 948 } 957 949 -
cmd.c
r0a0fb74 r36486be 147 147 cmd->name = owl_strdup(name); 148 148 cmd->cmd_aliased_to = owl_strdup(aliased_to); 149 cmd->summary = owl_malloc(strlen(aliased_to)+strlen(OWL_CMD_ALIAS_SUMMARY_PREFIX)+2); 150 strcpy(cmd->summary, OWL_CMD_ALIAS_SUMMARY_PREFIX); 151 strcat(cmd->summary, aliased_to); 149 cmd->summary = owl_sprintf("%s%s", OWL_CMD_ALIAS_SUMMARY_PREFIX, aliased_to); 152 150 return(0); 153 151 } … … 181 179 } else { 182 180 cmdbuffargs = skiptokens(cmdbuff, 1); 183 newcmd = owl_malloc(strlen(cmd->cmd_aliased_to)+strlen(cmdbuffargs)+2); 184 strcpy(newcmd, cmd->cmd_aliased_to); 185 strcat(newcmd, " "); 186 strcat(newcmd, cmdbuffargs); 181 newcmd = owl_sprintf("%s %s", cmd->cmd_aliased_to, cmdbuffargs); 187 182 rv = owl_function_command(newcmd); 188 183 owl_free(newcmd); … … 244 239 /* returns a summary line describing this keymap. the caller must free. */ 245 240 char *owl_cmd_describe(const owl_cmd *cmd) { 246 char *s;247 int slen;248 241 if (!cmd || !cmd->name || !cmd->summary) return NULL; 249 slen = strlen(cmd->name)+strlen(cmd->summary)+30; 250 s = owl_malloc(slen); 251 snprintf(s, slen-1, "%-25s - %s", cmd->name, cmd->summary); 252 return s; 242 return owl_sprintf("%-25s - %s", cmd->name, cmd->summary); 253 243 } 254 244 -
functions.c
r303a9e1 r36486be 2030 2030 2031 2031 buff = skiptokens(buff, 1); 2032 newbuff = owl_malloc(strlen(buff)+strlen(redirect)+1); 2033 strcpy(newbuff, buff); 2034 strcat(newbuff, redirect); 2032 newbuff = owl_sprintf("%s%s", buff, redirect); 2035 2033 2036 2034 if (type == 1) { -
keymap.c
r12bc46a r36486be 56 56 char *owl_keymap_summary(const owl_keymap *km) 57 57 { 58 char *s;59 int slen;60 58 if (!km || !km->name || !km->desc) return NULL; 61 slen = strlen(km->name)+strlen(km->desc)+20; 62 s = owl_malloc(slen); 63 snprintf(s, slen-1, "%-15s - %s", km->name, km->desc); 64 return s; 59 return owl_sprintf("%-15s - %s", km->name, km->desc); 65 60 } 66 61 -
util.c
r4083c49 r36486be 147 147 } else { 148 148 args=owl_realloc(args, sizeof(char *) * (count+1)); 149 args[count]=owl_malloc(strlen(foo)+1); 150 strcpy(args[count], foo); 149 args[count] = owl_strdup(foo); 151 150 count++; 152 151 } … … 325 324 /* add the argument */ 326 325 argv=owl_realloc(argv, sizeof(char *)*((*argc)+1)); 327 argv[*argc]=owl_malloc(strlen(curarg)+2); 328 strcpy(argv[*argc], curarg); 326 argv[*argc] = owl_strdup(curarg); 329 327 *argc=*argc+1; 330 328 strcpy(curarg, ""); -
zcrypt.c
re19eb97 r36486be 245 245 } else { 246 246 /* Prepare result to be returned */ 247 char *temp = keyfile; 248 keyfile = owl_malloc(strlen(temp) + 1); 249 if (keyfile) { 250 strcpy(keyfile, temp); 251 } else { 252 /* printf("Memory allocation error.\n"); */ 253 } 247 keyfile = owl_strdup(keyfile); 254 248 } 255 249 -
zephyr.c
r4083c49 r36486be 988 988 char *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip) 989 989 { 990 char *out; 991 992 out=owl_malloc(strlen(class)+strlen(inst)+strlen(recip)+30); 993 sprintf(out, "%s,%s,%s\n", class, inst, !strcmp(recip, "") ? "*" : recip); 994 return(out); 990 return owl_sprintf("%s,%s,%s\n", class, inst, !strcmp(recip, "") ? "*" : recip); 995 991 } 996 992 -
zwrite.c
r4083c49 r36486be 170 170 171 171 /* simple hack for now to nuke stderr */ 172 openline=owl_malloc(strlen(zsigproc)+40); 173 strcpy(openline,zsigproc);174 # if !(OWL_STDERR_REDIR)175 strcat(openline, " 2> /dev/null");172 #if OWL_STDERR_REDIR 173 openline = owl_strdup(zsigproc); 174 #else 175 openline = owl_sprintf("%s 2> /dev/null", zsigproc); 176 176 #endif 177 177 file=popen(openline, "r");
Note: See TracChangeset
for help on using the changeset viewer.