summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixCompat.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2025-03-30 08:41:50 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2025-03-30 08:41:50 (GMT)
commit254025c6d682cfde6e1cada371c419af7c60087b (patch)
tree80cef3a45304cecf6752d3c8c1d587ec3dc9974d /unix/tclUnixCompat.c
parentb915f649c229620e5a17add0e25b85ee99c9c91d (diff)
downloadtcl-254025c6d682cfde6e1cada371c419af7c60087b.zip
tcl-254025c6d682cfde6e1cada371c419af7c60087b.tar.gz
tcl-254025c6d682cfde6e1cada371c419af7c60087b.tar.bz2
Fix some -Wconversion warningscore-conversion-warning
Diffstat (limited to 'unix/tclUnixCompat.c')
-rw-r--r--unix/tclUnixCompat.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index def69fa..7120b86 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -107,11 +107,11 @@ static int CopyGrp(struct group *tgtPtr, char *buf, int buflen);
static int CopyPwd(struct passwd *tgtPtr, char *buf, int buflen);
#endif
-static int CopyArray(char **src, int elsize, char *buf,
- int buflen);
+static size_t CopyArray(char **src, int elsize, char *buf,
+ size_t buflen);
static int CopyHostent(struct hostent *tgtPtr, char *buf,
- int buflen);
-static int CopyString(const char *src, char *buf, int buflen);
+ size_t buflen);
+static size_t CopyString(const char *src, char *buf, size_t buflen);
#endif
@@ -754,10 +754,10 @@ static int
CopyHostent(
struct hostent *tgtPtr,
char *buf,
- int buflen)
+ size_t buflen)
{
char *p = buf;
- int copied, len = 0;
+ Tcl_Size copied, len = 0;
copied = CopyString(tgtPtr->h_name, p, buflen - len);
if (copied == -1) {
@@ -875,16 +875,16 @@ CopyPwd(
*/
#ifdef NEED_COPYARRAY
-static int
+static size_t
CopyArray(
char **src, /* Array of elements to copy. */
int elsize, /* Size of each element, or -1 to indicate
* that they are C strings of dynamic
* length. */
char *buf, /* Buffer to copy into. */
- int buflen) /* Size of buffer. */
+ size_t buflen) /* Size of buffer. */
{
- int i, j, len = 0;
+ size_t i, j, len = 0;
char *p, **newBuffer;
if (src == NULL) {
@@ -905,7 +905,7 @@ CopyArray(
p = buf + len;
for (j = 0; j < i; j++) {
- int sz = (elsize<0 ? (int) strlen(src[j]) + 1 : elsize);
+ size_t sz = (elsize<0 ? strlen(src[j]) + 1 : (size_t)elsize);
len += sz;
if (len > buflen) {
@@ -939,13 +939,13 @@ CopyArray(
*/
#ifdef NEED_COPYSTRING
-static int
+static size_t
CopyString(
const char *src, /* String to copy. */
char *buf, /* Buffer to copy into. */
- int buflen) /* Size of buffer. */
+ size_t buflen) /* Size of buffer. */
{
- int len = 0;
+ size_t len = 0;
if (src != NULL) {
len = strlen(src) + 1;