# HG changeset patch # User Mychaela Falconia # Date 1520205111 0 # Node ID ae2556e256a4162c84b0216f88e42b523016e8bd # Parent 68c8cf672ecd16ae44e5065f33ee6d3704d535ef uptools/libcoding: implemented function for generating hex strings diff -r 68c8cf672ecd -r ae2556e256a4 uptools/libcoding/Makefile --- a/uptools/libcoding/Makefile Sun Mar 04 06:24:36 2018 +0000 +++ b/uptools/libcoding/Makefile Sun Mar 04 23:11:51 2018 +0000 @@ -2,8 +2,9 @@ CFLAGS= -O2 OBJS= alpha_addr.o decode_helpers.o grokdcs.o gsm7_decode.o \ gsm7_decode_tables.o gsm7_encode.o gsm7_encode_table.o gsm7_pack.o \ - gsm7_unpack.o gsmtime.o hexdecode.o hexdump.o number_decode.o \ - number_encode.o scaddr.o sms_submit.o ucs2_decode.o utf8_decode.o + gsm7_unpack.o gsmtime.o hexdecode.o hexdump.o hexencode.o \ + number_decode.o number_encode.o scaddr.o sms_submit.o ucs2_decode.o \ + utf8_decode.o LIB= libcoding.a all: ${LIB} diff -r 68c8cf672ecd -r ae2556e256a4 uptools/libcoding/hexencode.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uptools/libcoding/hexencode.c Sun Mar 04 23:11:51 2018 +0000 @@ -0,0 +1,21 @@ +/* + * This module contains the function for generating hex strings. + */ + +#include +#include + +make_hex_string(inbuf, len, outbuf) + u_char *inbuf; + unsigned len; + char *outbuf; +{ + char *dp = outbuf; + unsigned n; + + for (n = 0; n < len; n++) { + sprintf(dp, "%02X", inbuf[n]); + dp += 2; + } + *dp = '\0'; +}