diff --git a/src/cscout.cpp b/src/cscout.cpp
index 87fb13e..463cd34 100644
--- a/src/cscout.cpp
+++ b/src/cscout.cpp
@@ -1758,7 +1758,7 @@ explore_functions(FILE *fo, Call *f,
if (((*i)->*fbegin)() != ((*i)->*fend)()) {
/* Functions below; create +/- hyperlink. */
char param[1024];
- sprintf(param, "f%02d%p", level, &(**i));
+ snprintf(param, sizeof(param), "f%02d%p", level, &(**i));
char *pval = swill_getvar(param);
if (pval) {
@@ -1829,14 +1829,14 @@ funlist_page(FILE *fo, void *p)
fbegin = &Call::caller_begin;
fend = &Call::caller_end;
fprintf(fo, "List of %s calling functions\n", calltype);
- sprintf(buff, " — call path from function", graph_suffix(), f);
+ snprintf(buff, sizeof(buff), " — call path from function", graph_suffix(), f);
break;
case 'd':
case 'D':
fbegin = &Call::call_begin;
fend = &Call::call_end;
fprintf(fo, "List of %s called functions\n", calltype);
- sprintf(buff, " — call path to function", graph_suffix(), f);
+ snprintf(buff, sizeof(buff), " — call path to function", graph_suffix(), f);
break;
}
if (swill_getvar("e")) {
@@ -3599,7 +3599,7 @@ main(int argc, char *argv[])
cout << Sql::getInterface()->end_commands();
#ifdef LINUX_STAT_MONITOR
char buff[100];
- sprintf(buff, "cat /proc/%u/stat >%u.stat", getpid(), getpid());
+ snprintf(buff, sizeof(buff), "cat /proc/%u/stat >%u.stat", getpid(), getpid());
if (system(buff) != 0) {
fprintf(stderr, "Unable to run %s\n", buff);
exit(1);
diff --git a/src/funquery.cpp b/src/funquery.cpp
index 5124488..f81af4a 100644
--- a/src/funquery.cpp
+++ b/src/funquery.cpp
@@ -161,7 +161,7 @@ FunQuery::param_url() const
if (id_ec) {
char buff[256];
- sprintf(buff, "&ec=%p", id_ec);
+ snprintf(buff, sizeof(buff), "&ec=%p", id_ec);
r += buff;
} else {
r += "&match=";
@@ -169,11 +169,11 @@ FunQuery::param_url() const
}
r += mquery.param_url();
if (call) {
- sprintf(buff, "&call=%p", call);
+ snprintf(buff, sizeof(buff), "&call=%p", call);
r += buff;
}
if (match_fid) {
- sprintf(buff, "&fid=%d", fid.get_id());
+ snprintf(buff, sizeof(buff), "&fid=%d", fid.get_id());
r += buff;
}
if (cfun)
diff --git a/src/idquery.cpp b/src/idquery.cpp
index 1308798..40f1c07 100644
--- a/src/idquery.cpp
+++ b/src/idquery.cpp
@@ -192,7 +192,7 @@ IdQuery::param_url() const
if (ec) {
char buff[256];
- sprintf(buff, "&ec=%p", ec);
+ snprintf(buff, sizeof(buff), "&ec=%p", ec);
r += buff;
} else {
r += "&match=";
diff --git a/src/md5.c b/src/md5.c
index f6b43a1..f181708 100644
--- a/src/md5.c
+++ b/src/md5.c
@@ -105,8 +105,8 @@ static unsigned char PADDING[64] = {
/* The routine MD5Init initializes the message-digest context
mdContext. All fields are set to zero.
*/
-void MD5Init (mdContext)
-MD5_CTX *mdContext;
+void
+MD5Init(MD5_CTX *mdContext)
{
mdContext->i[0] = mdContext->i[1] = (UINT4)0;
@@ -122,10 +122,8 @@ MD5_CTX *mdContext;
account for the presence of each of the characters inBuf[0..inLen-1]
in the message whose digest is being computed.
*/
-void MD5Update (mdContext, inBuf, inLen)
-MD5_CTX *mdContext;
-unsigned char *inBuf;
-unsigned int inLen;
+void
+MD5Update(MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen)
{
UINT4 in[16];
int mdi;
@@ -160,8 +158,8 @@ unsigned int inLen;
/* The routine MD5Final terminates the message-digest computation and
ends with the desired message digest in mdContext->digest[0...15].
*/
-void MD5Final (mdContext)
-MD5_CTX *mdContext;
+void
+MD5Final(MD5_CTX *mdContext)
{
UINT4 in[16];
int mdi;
diff --git a/src/md5.h b/src/md5.h
index fbac623..efd5e0d 100644
--- a/src/md5.h
+++ b/src/md5.h
@@ -59,10 +59,10 @@ typedef struct {
unsigned char digest[16]; /* actual digest after MD5Final call */
} MD5_CTX;
-void MD5Init ();
-void MD5Update ();
-void MD5Final ();
-unsigned char * MD5File(const char *fname);
+void MD5Init(MD5_CTX *mdContext);
+void MD5Update(MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen);
+void MD5Final(MD5_CTX *mdContext);
+unsigned char *MD5File(const char *fname);
#ifdef __cplusplus
}
diff --git a/src/option.cpp b/src/option.cpp
index 6c14242..bde6a68 100644
--- a/src/option.cpp
+++ b/src/option.cpp
@@ -75,8 +75,8 @@ BoolOption *Option::cgraph_dot_url; // Include URLs in dot output
vector