alpine 3.8
obsolete weakness #26

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:

gammu/src/gammu-1.39.0/gammu/depend/nokia/dct4.c

Context:

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

 	GSM_Error error;

	/* Set vibra level */
	unsigned char 	SetLevel[6] = {N7110_FRAME_HEADER,0x0E,
				       0x64,	/* Vibra power (in percent) */
				       0x00};

	GSM_Init(TRUE);

        CheckDCT4();

	gsm->User.UserReplyFunctions=UserReplyFunctions4;

	SetLevel[4] = GetInt(argv[2]);
	error=GSM_WaitFor (gsm, SetLevel, 6, 0x1C, 4, ID_User3);
	Print_Error(error);

	error=DCT4EnableVibra(gsm, TRUE);
	Print_Error(error);

	for (i=0;i<3;i++) {
		GSM_GetCurrentDateTime (&Date);
		j=Date.Second;
		while (j==Date.Second) {
			usleep(10000);
			GSM_GetCurrentDateTime(&Date);
		}
	}

	error=DCT4EnableVibra(gsm, FALSE);
	Print_Error(error);

	GSM_Terminate();
}

void DCT4VibraTest(int argc, char *argv[])
{
	unsigned char ans[200];
	GSM_Error error;

	if (CheckDCT4Only()!=ERR_NONE) return;

	gsm->User.UserReplyFunctions=UserReplyFunctions4;

	error=DCT4EnableVibra(gsm, TRUE);
	Print_Error(error);

	printf("%s\n", _("Press any key to continue..."));
	GetLine(stdin, ans, 99);
 

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.