Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
liewegas committed Sep 22, 2011
2 parents f9c3cb1 + e124b15 commit c552323
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/include/addr_parsing.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ int safe_cat(char **pstr, int *plen, int pos, const char *str2)
{
int len2 = strlen(str2);

//printf("safe_cat '%s' max %d pos %d '%s' len %d\n", *pstr, *plen, pos, str2, len2);
while (*plen < pos + len2 + 1) {
*plen += BUF_SIZE;
*pstr = (char *)realloc(*pstr, (size_t)*plen);
Expand All @@ -32,9 +33,11 @@ int safe_cat(char **pstr, int *plen, int pos, const char *str2)
printf("Out of memory\n");
exit(1);
}
//printf("safe_cat '%s' max %d pos %d '%s' len %d\n", *pstr, *plen, pos, str2, len2);
}

strncpy((*pstr)+pos, str2, len2);
(*pstr)[pos+len2] = '\0';

return pos + len2;
}
Expand Down
2 changes: 1 addition & 1 deletion src/mount/mount.ceph.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ static char *mount_resolve_src(const char *orig_str)
}

src = resolve_addrs(buf);
free(buf);
if (!src)
return NULL;

len = strlen(src);
pos = safe_cat(&src, &len, len, ":");
safe_cat(&src, &len, pos, mount_path);

free(buf);
return src;
}

Expand Down

0 comments on commit c552323

Please sign in to comment.