Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
44335bcf
Commit
44335bcf
authored
Jul 23, 2019
by
rswindell
Browse files
Address warnings reported by gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516
parent
55a2e1e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
18 deletions
+18
-18
src/sbbs3/chk_ar.cpp
src/sbbs3/chk_ar.cpp
+2
-2
src/sbbs3/chksmb.c
src/sbbs3/chksmb.c
+1
-1
src/smblib/smbadd.c
src/smblib/smbadd.c
+2
-2
src/smblib/smblib.c
src/smblib/smblib.c
+13
-13
No files found.
src/sbbs3/chk_ar.cpp
View file @
44335bcf
...
...
@@ -679,7 +679,7 @@ bool sbbs_t::ar_exp(const uchar **ptrptr, user_t* user, client_t* client)
}
break
;
case
AR_COLS
:
if
((
equal
&&
cols
!=
n
)
||
(
!
equal
&&
cols
<
(
long
)
n
))
if
((
equal
&&
cols
!=
(
long
)
n
)
||
(
!
equal
&&
cols
<
(
long
)
n
))
result
=
_not
;
else
result
=!
_not
;
...
...
@@ -689,7 +689,7 @@ bool sbbs_t::ar_exp(const uchar **ptrptr, user_t* user, client_t* client)
}
break
;
case
AR_ROWS
:
if
((
equal
&&
rows
!=
n
)
||
(
!
equal
&&
rows
<
(
long
)
n
))
if
((
equal
&&
rows
!=
(
long
)
n
)
||
(
!
equal
&&
rows
<
(
long
)
n
))
result
=
_not
;
else
result
=!
_not
;
...
...
src/sbbs3/chksmb.c
View file @
44335bcf
...
...
@@ -279,7 +279,7 @@ int main(int argc, char **argv)
off_t
sid_length
=
filelength
(
fileno
(
smb
.
sid_fp
));
if
(
sid_length
!=
smb
.
status
.
total_msgs
*
sizeof
(
idxrec_t
))
{
printf
(
"!Size of index file (%ld) is incorrect (expected: %ld)
\n
"
,
sid_length
,
smb
.
status
.
total_msgs
*
sizeof
(
idxrec_t
));
printf
(
"!Size of index file (%ld) is incorrect (expected: %ld)
\n
"
,
sid_length
,
(
long
)(
smb
.
status
.
total_msgs
*
sizeof
(
idxrec_t
))
)
;
smb_close
(
&
smb
);
errors
++
;
continue
;
...
...
src/smblib/smbadd.c
View file @
44335bcf
...
...
@@ -199,7 +199,7 @@ int SMBCALL smb_addmsg(smb_t* smb, smbmsg_t* msg, int storage, long dupechk_hash
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%s writing body (%ld bytes)"
,
__FUNCTION__
,
bodylen
);
,
(
long
)
bodylen
);
retval
=
SMB_ERR_WRITE
;
break
;
}
...
...
@@ -222,7 +222,7 @@ int SMBCALL smb_addmsg(smb_t* smb, smbmsg_t* msg, int storage, long dupechk_hash
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%s writing tail (%ld bytes)"
,
__FUNCTION__
,
taillen
-
sizeof
(
xlat
));
,
(
long
)(
taillen
-
sizeof
(
xlat
))
)
;
retval
=
SMB_ERR_WRITE
;
break
;
}
...
...
src/smblib/smblib.c
View file @
44335bcf
...
...
@@ -988,8 +988,8 @@ int SMBCALL smb_getmsghdr(smb_t* smb, smbmsg_t* msg)
&&
(
msg
->
dfield
=
malloc
(
sizeof
(
*
msg
->
dfield
)
*
msg
->
hdr
.
total_dfields
))
==
NULL
)
{
smb_freemsgmem
(
msg
);
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%s malloc failure of %l
u
bytes for %u data fields"
,
__FUNCTION__
,
sizeof
(
*
msg
->
dfield
)
*
msg
->
hdr
.
total_dfields
,
msg
->
hdr
.
total_dfields
);
,
"%s malloc failure of %l
d
bytes for %u data fields"
,
__FUNCTION__
,
(
long
)(
sizeof
(
*
msg
->
dfield
)
*
msg
->
hdr
.
total_dfields
)
,
msg
->
hdr
.
total_dfields
);
return
(
SMB_ERR_MEM
);
}
i
=
fread
(
msg
->
dfield
,
sizeof
(
*
msg
->
dfield
),
msg
->
hdr
.
total_dfields
,
smb
->
shd_fp
);
...
...
@@ -1119,8 +1119,8 @@ int SMBCALL smb_copymsgmem(smb_t* smb, smbmsg_t* msg, smbmsg_t* srcmsg)
if
((
msg
->
dfield
=
(
dfield_t
*
)
malloc
(
msg
->
hdr
.
total_dfields
*
sizeof
(
dfield_t
)))
==
NULL
)
{
if
(
smb
!=
NULL
)
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%s malloc failure of %l
u
bytes for %d data fields"
,
__FUNCTION__
,
msg
->
hdr
.
total_dfields
*
sizeof
(
dfield_t
),
msg
->
hdr
.
total_dfields
);
,
"%s malloc failure of %l
d
bytes for %d data fields"
,
__FUNCTION__
,
(
long
)(
msg
->
hdr
.
total_dfields
*
sizeof
(
dfield_t
)
)
,
msg
->
hdr
.
total_dfields
);
return
(
SMB_ERR_MEM
);
}
memcpy
(
msg
->
dfield
,
srcmsg
->
dfield
,
msg
->
hdr
.
total_dfields
*
sizeof
(
dfield_t
));
...
...
@@ -1131,8 +1131,8 @@ int SMBCALL smb_copymsgmem(smb_t* smb, smbmsg_t* msg, smbmsg_t* srcmsg)
if
((
msg
->
hfield
=
(
hfield_t
*
)
malloc
(
msg
->
total_hfields
*
sizeof
(
hfield_t
)))
==
NULL
)
{
if
(
smb
!=
NULL
)
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%s malloc failure of %l
u
bytes for %d header fields"
,
__FUNCTION__
,
msg
->
total_hfields
*
sizeof
(
hfield_t
),
msg
->
total_hfields
);
,
"%s malloc failure of %l
d
bytes for %d header fields"
,
__FUNCTION__
,
(
long
)(
msg
->
total_hfields
*
sizeof
(
hfield_t
)
)
,
msg
->
total_hfields
);
return
(
SMB_ERR_MEM
);
}
memcpy
(
msg
->
hfield
,
srcmsg
->
hfield
,
msg
->
total_hfields
*
sizeof
(
hfield_t
));
...
...
@@ -1141,8 +1141,8 @@ int SMBCALL smb_copymsgmem(smb_t* smb, smbmsg_t* msg, smbmsg_t* srcmsg)
if
((
msg
->
hfield_dat
=
(
void
**
)
malloc
(
msg
->
total_hfields
*
sizeof
(
void
*
)))
==
NULL
)
{
if
(
smb
!=
NULL
)
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%s malloc failure of %l
u
bytes for %d header fields"
,
__FUNCTION__
,
msg
->
total_hfields
*
sizeof
(
void
*
),
msg
->
total_hfields
);
,
"%s malloc failure of %l
d
bytes for %d header fields"
,
__FUNCTION__
,
(
long
)(
msg
->
total_hfields
*
sizeof
(
void
*
)
)
,
msg
->
total_hfields
);
return
(
SMB_ERR_MEM
);
}
...
...
@@ -1505,8 +1505,8 @@ int SMBCALL smb_addcrc(smb_t* smb, uint32_t crc)
if
(
wr
!=
sizeof
(
crc
))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%s %d '%s' writing %l
u
bytes"
,
__FUNCTION__
,
get_errno
(),
STRERROR
(
get_errno
()),
sizeof
(
crc
));
,
"%s %d '%s' writing %l
d
bytes"
,
__FUNCTION__
,
get_errno
(),
STRERROR
(
get_errno
()),
(
long
)
sizeof
(
crc
));
return
(
SMB_ERR_WRITE
);
}
...
...
@@ -1553,7 +1553,7 @@ int SMBCALL smb_addmsghdr(smb_t* smb, smbmsg_t* msg, int storage)
if
(
idxlen
!=
(
smb
->
status
.
total_msgs
*
sizeof
(
idxrec_t
)))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%s index file length (%ld) unexpected (%ld)"
,
__FUNCTION__
,
idxlen
,
smb
->
status
.
total_msgs
*
sizeof
(
idxrec_t
));
,
idxlen
,
(
long
)(
smb
->
status
.
total_msgs
*
sizeof
(
idxrec_t
))
)
;
smb_unlocksmbhdr
(
smb
);
return
SMB_ERR_FILE_LEN
;
}
...
...
@@ -1764,8 +1764,8 @@ int SMBCALL smb_putmsgidx(smb_t* smb, smbmsg_t* msg)
length
=
filelength
(
fileno
(
smb
->
sid_fp
));
if
(
length
<
(
long
)(
msg
->
offset
*
sizeof
(
idxrec_t
)))
{
safe_snprintf
(
smb
->
last_error
,
sizeof
(
smb
->
last_error
)
,
"%s invalid index offset: %ld, byte offset: %l
u
, length: %lu"
,
__FUNCTION__
,(
long
)
msg
->
offset
,
msg
->
offset
*
sizeof
(
idxrec_t
),
length
);
,
"%s invalid index offset: %ld, byte offset: %l
d
, length: %lu"
,
__FUNCTION__
,(
long
)
msg
->
offset
,
(
long
)(
msg
->
offset
*
sizeof
(
idxrec_t
)
)
,
length
);
return
(
SMB_ERR_HDR_OFFSET
);
}
if
(
fseek
(
smb
->
sid_fp
,
msg
->
offset
*
sizeof
(
idxrec_t
),
SEEK_SET
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment