Skip to content

Commit 70323c8

Browse files
authored
Fix some gcc warnings (#119)
* smb: Fix string overflow * modplay: Fix indentation warning * smb: Disable unused DES keys
1 parent ba0a035 commit 70323c8

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

libmodplay/mixer.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4747

4848

4949
#define MIX_SAMPLES \
50-
accum = (s32)b[i] + (s32)((((s32)data[playpos.aword.high]*volume)>>6) << shiftval); \
51-
if(accum<-32768) accum = -32768; if(accum>32767) accum = 32767; \
50+
accum = (s32)b[i] + (s32)((((s32)data[playpos.aword.high]*volume)>>6) << shiftval); \
51+
if(accum<-32768) accum = -32768; \
52+
if(accum>32767) accum = 32767; \
5253
b[i] = accum; \
5354
playpos.adword+=incval; \
5455
if ( playpos.adword>=loop_end ) \

libtinysmb/des.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ static const unsigned char encrypt_rotate_tab[16] = {
157157
1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1
158158
};
159159

160+
161+
#if 0 // unused
160162
/*
161163
* Table with weak DES keys sorted in ascending order. In DES there
162164
* are 64 known keys which are weak. They are weak because they
@@ -230,6 +232,7 @@ static const unsigned char weak_keys[64][8] = {
230232
{0xfe, 0xfe, 0xe0, 0xe0, 0xfe, 0xfe, 0xf0, 0xf0},
231233
{0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe} /*w */
232234
};
235+
#endif
233236

234237
/*
235238
* Macro to swap bits across two words.

libtinysmb/smb_devoptab.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1456,7 +1456,7 @@ bool smbInitDevice(const char* name, const char *user, const char *password, con
14561456
{
14571457
int i;
14581458

1459-
if(!name || strlen(name) > 9)
1459+
if(!name || strlen(name) > 8)
14601460
return false;
14611461

14621462
char devname[10];

0 commit comments

Comments
 (0)