BAN-AI-Communications/k95-mingw

View on GitHub
k95source/ckclib.c

Summary

Maintainability
Test Coverage

Showing 46 of 46 total issues

Too many #ifdef configurations - cppcheck only checks 12 of 223 configurations. Use --force to check all configurations.
Open

/* End of ckclib.c */
Severity: Info
Found in k95source/ckclib.c by cppcheck

Uninitialized variable: dot
Open

if (!dot) { /* For UNIX file globbing */
Severity: Critical
Found in k95source/ckclib.c by cppcheck

Either the condition i>k is redundant, otherwise there is negative array index -2.
Open

hexbuf[15-i] = '0';
Severity: Minor
Found in k95source/ckclib.c and 1 other location by cppcheck
k95source/ckclib.c on lines 2509..2509

Either the condition i>k is redundant, otherwise there is negative array index -1.
Open

hexbuf[15-i] = x + ((x < 10) ? '0' : 0x37);
Severity: Minor
Found in k95source/ckclib.c and 1 other location by cppcheck
k95source/ckclib.c on lines 2509..2509

XXX found
Open

"SOS", "XXX", "SCI", "CSI", "ST", "OSC", "PM", "APC", "NBS"
Severity: Minor
Found in k95source/ckclib.c by fixme

XXX found
Open

"XXX", "XXX", "BPH", "NBH", "IND", "NEL", "SSA", "ESA",
Severity: Minor
Found in k95source/ckclib.c by fixme

XXX found
Open

"XXX", "XXX", "BPH", "NBH", "IND", "NEL", "SSA", "ESA",
Severity: Minor
Found in k95source/ckclib.c by fixme

Boolean result is used in bitwise operation. Clarify expression with parentheses.
Open

(opts & 2 == 0) || /* always if not file */
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable t2 can be reduced.
Open

CHAR t1, t2;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable p can be reduced.
Open

char *p, *a[4];
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable p can be reduced.
Open

char *p, *a[12];
Severity: Minor
Found in k95source/ckclib.c by cppcheck

Variable p is reassigned a value before the old one has been used.
Open

p = s1;
Severity: Minor
Found in k95source/ckclib.c and 1 other location by cppcheck
k95source/ckclib.c on lines 2759..2759

The scope of the variable c2 can be reduced.
Open

char c1, c2, * s3;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable ch2 can be reduced.
Open

char * p, ch, ch2;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable t1 can be reduced.
Open

register CHAR t1, t2;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable q2 can be reduced.
Open

register char * q2;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable i can be reduced.
Open

register int i, k;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable x can be reduced.
Open

int len1 = 0, len2 = 0, i, j, x, ot = t; /* ot = original t */
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable t2 can be reduced.
Open

register CHAR t1, t2;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable b3 can be reduced.
Open

int b3, b4, i, x = 0;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable c can be reduced.
Open

unsigned char c;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable d can be reduced.
Open

int d, count = 0;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable b4 can be reduced.
Open

int b3, b4, i, x = 0;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable s3 can be reduced.
Open

char c1, c2, * s3;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable x can be reduced.
Open

int k, x, len = 0, sign = 0;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable ch can be reduced.
Open

char * p, ch, ch2;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

Local variable q shadows outer variable
Open

int q = 0; /* My own private q */
Severity: Minor
Found in k95source/ckclib.c and 1 other location by cppcheck
k95source/ckclib.c on lines 1363..1363

Local variable k shadows outer variable
Open

int k, n, q = 0;
Severity: Minor
Found in k95source/ckclib.c and 1 other location by cppcheck
k95source/ckclib.c on lines 1363..1363

The scope of the variable x can be reduced.
Open

int k, x, len = 0;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

Local variable k shadows outer variable
Open

int k, sofar;
Severity: Minor
Found in k95source/ckclib.c and 1 other location by cppcheck
k95source/ckclib.c on lines 1363..1363

The scope of the variable t1 can be reduced.
Open

CHAR t1, t2;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

Local variable q shadows outer variable
Open

int q = 0, done = 0;
Severity: Minor
Found in k95source/ckclib.c and 1 other location by cppcheck
k95source/ckclib.c on lines 1363..1363

Condition 2==0 is always false
Open

(opts & 2 == 0) || /* always if not file */
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable x can be reduced.
Open

int k, x, len = 0, sign = 0;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

Local variable q shadows outer variable
Open

int k, n, q = 0;
Severity: Minor
Found in k95source/ckclib.c and 1 other location by cppcheck
k95source/ckclib.c on lines 1363..1363

Suspicious condition (bitwise operator + comparison); Clarify expression with parentheses.
Open

(opts & 2 == 0) || /* always if not file */
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable t can be reduced.
Open

int i, k = 0, x, t;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

Condition !q is always true
Open

if (!q) {
Severity: Minor
Found in k95source/ckclib.c and 1 other location by cppcheck
k95source/ckclib.c on lines 1741..1741

Array index i is used before limits check.
Open

for (i = 0; src[i] && (i < len-1); i++) /* Args OK, copy */
Severity: Minor
Found in k95source/ckclib.c by cppcheck

Array index i is used before limits check.
Open

for (i = 0, j = strlen(dest); src[i] && (i < len-j-1); i++)
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable c can be reduced.
Open

char c, *r = rxresult;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The scope of the variable t can be reduced.
Open

unsigned int t;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The function ckstrpbrk is never used.
Open

ckstrpbrk(s1, s2) char * s1, * s2; {
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The function ckstrstr is never used.
Open

ckstrstr(s1, s2) char * s1, * s2; {
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The function ckstrrchr is never used.
Open

ckstrrchr(s,c) char *s, c;
Severity: Minor
Found in k95source/ckclib.c by cppcheck

The function ckupper is never used.
Open

ckupper(s) char *s; {
Severity: Minor
Found in k95source/ckclib.c by cppcheck
Category
Status