summaryrefslogtreecommitdiffstats
path: root/call/yapp.c
Commit message (Collapse)AuthorAgeFilesLines
* Call: Remove duplicate #include.Ralf Baechle2017-08-081-1/+0
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* treewide: Kill assignments in if conditions.Ralf Baechle2017-08-031-26/+34
| | | | | | | | | | | | | | | | | | | Somewhat hard to read and the code base already has many overlong lines Found with below spatch files: @parens@ expression E, F, G; binary operator X; statement S; @@ - if ((E = F) X G) + E = F; + if (E X G) S Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* call: Fix structure mismatchRalf Baechle2017-07-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | GCC with LTO enabled warn: /bin/sh ../libtool --tag=CC --mode=link gcc -O2 -Wall -flto -o call call.o menu.o crc.o yapp.o dostime.o -lncursesw -lax25 libtool: link: gcc -O2 -Wall -flto -o call call.o menu.o crc.o yapp.o dostime.o -lncursesw -lax25 menu.h:22:9: warning: type of 'winopen' does not match original declaration [-Wlto-type-mismatch] WINDOW* winopen(wint*, int, int, int, int, int); ^ menu.c:20:9: note: 'winopen' was previously declared here WINDOW *winopen(wint * wtab, int nlines, int ncols, int begin_y, ^ menu.c:20:9: note: code may be misoptimized unless -fno-strict-aliasing is used This was caused by different .c files being built with different libc feature selection macros. Adding #define _DEFAULT_SOURCE #define _XOPEN_SOURCE #define _XOPEN_SOURCE_EXTENDED to menu.c would have been sufficient but it seems good practice to add the same definition to all .c files. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* call: Fix buffer overflow.Ralf Baechle2017-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | When sending files of 1GB or larger, size_buffer was not large enough to hold the number including a trailing \0. This also fixes the following warning: gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -Wall -MT yapp.o -MD -MP -MF .deps/yapp.Tpo -c -o yapp.o yapp.c yapp.c: In function ‘yapp_upload_data’: yapp.c:200:24: warning: ‘%ld’ directive writing between 1 and 11 bytes into a region of size 10 [-Wformat-overflow=] sprintf(size_buffer, "%ld", length); ^~~ yapp.c:200:23: note: directive argument in the range [-2147483648, 2147483647] sprintf(size_buffer, "%ld", length); ^~~~~ yapp.c:200:2: note: ‘sprintf’ output between 2 and 12 bytes into a destination of size 10 sprintf(size_buffer, "%ld", length); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* listen: Fix signedness compiler warnings.Ralf Baechle2015-06-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make[2]: Entering directory '/home/ralf/src/ax25/ax25-apps/listen' gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -Wall -MT listen.o -MD -MP -MF .deps/listen.Tpo -c -o listen.o listen.c listen.c: In function ‘ascii_dump’: listen.c:231:4: warning: pointer targets in passing argument 2 of ‘__builtin_strncat’ differ in signedness [-Wpointer-sign] strncat(buf, &c, 1); ^ listen.c:231:4: note: expected ‘const char *’ but argument is of type ‘unsigned char *’ listen.c: In function ‘hex_dump’: listen.c:282:8: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] data2 = data; ^ [...] gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -Wall -MT rosedump.o -MD -MP -MF .deps/rosedump.Tpo -c -o rosedump.o rosedump.c rosedump.c: In function ‘facility’: rosedump.c:331:9: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] factot = data; ^ rosedump.c:398:11: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] for (d = data, l = 0; l < lgaddcall; ^ rosedump.c:406:28: warning: pointer targets in passing argument 1 of ‘dump_ax25_call’ differ in signedness [-Wpointer-sign] dump_ax25_call(d, 7)); ^ rosedump.c:296:14: note: expected ‘unsigned char *’ but argument is of type ‘char *’ static char *dump_ax25_call(unsigned char *data, int l_data) ^ rosedump.c:410:28: warning: pointer targets in passing argument 1 of ‘dump_ax25_call’ differ in signedness [-Wpointer-sign] dump_ax25_call(d, 7)); ^ rosedump.c:296:14: note: expected ‘unsigned char *’ but argument is of type ‘char *’ static char *dump_ax25_call(unsigned char *data, int l_data) ^ rosedump.c:438:4: warning: pointer targets in passing argument 2 of ‘__builtin_strncpy’ differ in signedness [-Wpointer-sign] strncpy(indorig, data, lgadind); ^ rosedump.c:438:4: note: expected ‘const char *’ but argument is of type ‘unsigned char *’ rosedump.c:441:4: warning: pointer targets in passing argument 2 of ‘__builtin_strncpy’ differ in signedness [-Wpointer-sign] strncpy(inddest, data, lgadind); ^ rosedump.c:441:4: note: expected ‘const char *’ but argument is of type ‘unsigned char *’ rosedump.c:451:14: warning: pointer targets in passing argument 1 of ‘data_dump’ differ in signedness [-Wpointer-sign] data_dump(factot, lgtot, 1); ^ In file included from rosedump.c:11:0: listen.h:31:6: note: expected ‘unsigned char *’ but argument is of type ‘char *’ void data_dump(unsigned char *, int, int); ^ [...] gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -Wall -MT utils.o -MD -MP -MF .deps/utils.Tpo -c -o utils.o utils.c utils.c: In function ‘lprintf’: utils.c:49:10: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] for (p = str; *p != '\0'; p++) { ^ utils.c:71:10: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] for (p = str; *p != '\0'; p++) ^ [...] make[2]: Leaving directory '/home/ralf/src/ax25/ax25-apps/listen' Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Remove parenthesis around arguments of return statements.Ralf Baechle2015-05-021-16/+16
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Nuke trailing whitespace.Ralf Baechle2015-05-021-1/+1
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Kill a ton of useless casts to char * all over the code.Ralf Baechle2013-06-171-2/+2
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* remerged with terry indentsCraig Small2001-11-271-0/+4
|
* updated libtool, uniformly indented source, corrected small ax25mond ↵Terry Dawson VK2KTJ2001-09-121-429/+415
| | | | Makefile bug
* Import ax25-apps 0.0.1 from tarballax25-apps-0.0.1Ralf Baechle1999-06-071-0/+840