view rvinterf/l1filter/init.c @ 1011:6d9b10633f10 default tip

etmsync Pirelli IMEI retrieval: fix poor use of printf() Bug reported by Vadim Yanitskiy <fixeria@osmocom.org>: the construct where a static-allocated string was passed to printf() without any format arguments causes newer compilers to report a security problem. Given that formatted output is not needed here, just fixed string output, change printf() to fputs(), and direct the error message to stderr while at it.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 23 May 2024 17:29:57 +0000
parents ea458ee48691
children
line wrap: on
line source

/*
 * This module implements some init for l1trace-filter.
 */

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "pktmux.h"
#include "localsock.h"

extern int sock;

send_init_command(cmdpkt, cmdlen)
	u_char *cmdpkt;
{
	u_char lenbuf[2];

	lenbuf[0] = 0;
	lenbuf[1] = cmdlen;
	write(sock, lenbuf, 2);
	write(sock, cmdpkt, cmdlen);
}

init()
{
	static u_char want_l1_mux[2] = {CLI2RVI_WANT_MUXPROTO, RVT_L1_HEADER};

	localsock_prep_for_length_rx();
	send_init_command(want_l1_mux, 2);
}