summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author(no author) <(no author)@13f79535-47bb-0310-9956-ffa450edef68>2004-06-28 18:12:28 +0000
committer(no author) <(no author)@13f79535-47bb-0310-9956-ffa450edef68>2004-06-28 18:12:28 +0000
commit923e764d574e035647bbed221ba64b14c6c93e01 (patch)
tree8c501c6bd435eb0e342d39509f3130509bb2a58f
parent311d95f8dfddee0c54e8afc664344f8e41cad9cb (diff)
downloadlibapr-APACHE_2_0_50.tar.gz
This commit was manufactured by cvs2svn to create tagAPACHE_2_0_50
'APACHE_2_0_50'. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/tags/APACHE_2_0_50@65229 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--file_io/os2/filesys.c13
-rw-r--r--strings/apr_strings.c9
-rw-r--r--threadproc/beos/proc.c6
3 files changed, 15 insertions, 13 deletions
diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c
index b323e488d..ef597b38e 100644
--- a/file_io/os2/filesys.c
+++ b/file_io/os2/filesys.c
@@ -94,12 +94,13 @@ apr_status_t filepath_drive_get(char **rootpath, char drive,
apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p)
{
- char path[APR_PATH_MAX];
-
- strcpy(path, root);
- if (path[1] == ':')
- path[0] = apr_toupper(path[0]);
- *rootpath = apr_pstrdup(p, path);
+ if (root[0] && apr_islower(root[0]) && root[1] == ':') {
+ *rootpath = apr_pstrdup(p, root);
+ (*rootpath)[0] = apr_toupper((*rootpath)[0]);
+ }
+ else {
+ *rootpath = root;
+ }
return APR_SUCCESS;
}
diff --git a/strings/apr_strings.c b/strings/apr_strings.c
index a88f35e09..384a8c035 100644
--- a/strings/apr_strings.c
+++ b/strings/apr_strings.c
@@ -429,7 +429,8 @@ APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf)
return strcpy(buf, " - ");
}
if (size < 973) {
- sprintf(buf, "%3d ", (int) size);
+ if (apr_snprintf(buf, 5, "%3d ", (int) size) < 0)
+ return strcpy(buf, "****");
return buf;
}
do {
@@ -442,12 +443,14 @@ APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf)
if (size < 9 || (size == 9 && remain < 973)) {
if ((remain = ((remain * 5) + 256) / 512) >= 10)
++size, remain = 0;
- sprintf(buf, "%d.%d%c", (int) size, remain, *o);
+ if (apr_snprintf(buf, 5, "%d.%d%c", (int) size, remain, *o) < 0)
+ return strcpy(buf, "****");
return buf;
}
if (remain >= 512)
++size;
- sprintf(buf, "%3d%c", (int) size, *o);
+ if (apr_snprintf(buf, 5, "%3d%c", (int) size, *o) < 0)
+ return strcpy(buf, "****");
return buf;
} while (1);
}
diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c
index ff6ac1e0d..d733de138 100644
--- a/threadproc/beos/proc.c
+++ b/threadproc/beos/proc.c
@@ -114,12 +114,10 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr,
const char *dir)
{
char * cwd;
- if (strncmp("/",dir,1) != 0 ) {
+ if (dir[0] != '/') {
cwd = (char*)malloc(sizeof(char) * PATH_MAX);
getcwd(cwd, PATH_MAX);
- strncat(cwd,"/\0",2);
- strcat(cwd,dir);
- attr->currdir = (char *)apr_pstrdup(attr->pool, cwd);
+ attr->currdir = (char *)apr_pstrcat(attr->pool, cwd, "/", dir, NULL);
free(cwd);
} else {
attr->currdir = (char *)apr_pstrdup(attr->pool, dir);