diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-07-12 22:30:41 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-07-12 22:30:41 -0700 |
commit | c6ade914363426facb01a954650b804657114012 (patch) | |
tree | cd06caef24ef2bb064997df6b3dae6bdede71b64 /src/session.c | |
parent | ab689e1a711bbbdfcd6d3a8d2edebbc378ebccb7 (diff) |
Replace most sprintf calls with snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/session.c')
-rw-r--r-- | src/session.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/session.c b/src/session.c index 297f207..485eaf3 100644 --- a/src/session.c +++ b/src/session.c @@ -738,7 +738,7 @@ int *pFd; char tempFile[PATH_MAX]; char *tmp; - sprintf (tempFile, "%s/%sXXXXXX", path, prefix); + snprintf (tempFile, sizeof(tempFile), "%s/%sXXXXXX", path, prefix); tmp = (char *) mktemp (tempFile); if (tmp) { @@ -753,7 +753,7 @@ int *pFd; char tempFile[PATH_MAX]; char *ptr; - sprintf (tempFile, "%s/%sXXXXXX", path, prefix); + snprintf (tempFile, sizeof(tempFile), "%s/%sXXXXXX", path, prefix); ptr = (char *)malloc(strlen(tempFile) + 1); if (ptr != NULL) { @@ -802,7 +802,7 @@ SmPointer clientData; prop1val.value = Argv[0]; prop1val.length = strlen (Argv[0]); - sprintf (userId, "%ld", (long)getuid()); + snprintf (userId, sizeof(userId), "%ld", (long)getuid()); prop2.name = SmUserID; prop2.type = SmARRAY8; prop2.num_vals = 1; @@ -921,7 +921,7 @@ SmPointer clientData; prop1.num_vals = numVals; - sprintf (discardCommand, "rm %s", filename); + snprintf (discardCommand, sizeof(discardCommand), "rm %s", filename); prop2.name = SmDiscardCommand; prop2.type = SmARRAY8; prop2.num_vals = 1; |