summaryrefslogtreecommitdiffstats
path: root/src/clients
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1994-07-16 03:47:03 +0000
committerTheodore Tso <tytso@mit.edu>1994-07-16 03:47:03 +0000
commit367b51f4201c9e996e138b56e25aee1c8787d0ea (patch)
tree4529a8f1b60ddabfa985815ebb89c4561c8ce437 /src/clients
parentd9b286523a8c470c42eeb532799179ba0b97861a (diff)
downloadkrb5-367b51f4201c9e996e138b56e25aee1c8787d0ea.tar.gz
krb5-367b51f4201c9e996e138b56e25aee1c8787d0ea.tar.xz
krb5-367b51f4201c9e996e138b56e25aee1c8787d0ea.zip
Change to use POSIX getcwd() instead of getwd()
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3985 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/clients')
-rw-r--r--src/clients/ksu/ChangeLog5
-rw-r--r--src/clients/ksu/main.c24
2 files changed, 17 insertions, 12 deletions
diff --git a/src/clients/ksu/ChangeLog b/src/clients/ksu/ChangeLog
new file mode 100644
index 0000000000..334e790902
--- /dev/null
+++ b/src/clients/ksu/ChangeLog
@@ -0,0 +1,5 @@
+Fri Jul 15 23:45:34 1994 Theodore Y. Ts'o (tytso at tsx-11)
+
+ * ksu.c (get_dir_of_file): Change to use POSIX getcwd() function.
+
+
diff --git a/src/clients/ksu/main.c b/src/clients/ksu/main.c
index dfe8db2c3b..909ada3fe6 100644
--- a/src/clients/ksu/main.c
+++ b/src/clients/ksu/main.c
@@ -933,20 +933,20 @@ va_list ap;
}
-char * get_dir_of_file( char * path){
-
-char * temp_path;
-char * ptr;
+char *get_dir_of_file(char * path)
+{
+ char * temp_path;
+ char * ptr;
-temp_path = strdup(path);
+ temp_path = strdup(path);
-if (ptr = strrchr( temp_path, '/')){
+ if (ptr = strrchr( temp_path, '/')) {
*ptr = '\0';
-}else{
+ } else {
free (temp_path);
- temp_path = (char *) calloc(MAXPATHLEN, sizeof(char));
- temp_path = (char *) getwd(temp_path);
-}
-
-return temp_path;
+ temp_path = malloc(MAXPATHLEN);
+ if (temp_path)
+ getcwd(temp_path, MAXPATHLEN);
+ }
+ return temp_path;
}