alpine 3.6
obsolete weakness #272

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

umix/src/umix-1.0.2/src/umix_common.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.6 obsolete weakness.

 		rinc = ABS(rinc);
	}
	else
		rdir = 1;
	rinc /= steps;

	/* milliseconds, maximum is 5000 (5 seconds) */
	delay = CLAMP(delay, 0, 5000);
	delay *= 1000;
	/* correct direction */
	linc *= ldir;
	rinc *= rdir;
#ifdef UMIX_DEBUG
	err_msg("slidevol: ldiff=%3f rdiff=%3f steps=%d delay=%d", 
		ldiff, rdiff, steps, delay);
#endif
	for (i=0; i<steps; i++)
	{
		lr_to_vb(fleft, fright, &fvb.volume, &fvb.balance);
		chan_set_vb(fvb);

		fleft += linc;
		fright += rinc;

		usleep(delay);
	}

	return 0;
}

/* the mixer that is used when parsing mixer settings */
static int set_mixer = -1;

/* load settings from file defined in path */
int settings_load(const char *path, int mode)
{
	FILE *fp;
	void (*parseline)(char *buf);
	size_t n;
	int globalfound; 
	int mixersfound;
	char buf[LINEWIDTH];

	globalfound = 0;
	mixersfound = 0;

	/* lines are parsed depending on the mode */
	if (mode == UMIX_SET_GLOBAL)
		parseline = parseglobal;
	else 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.