Recent compilers complain with the following message:
main.cpp: In function ‘void split_item(STRING_VECTOR&, char*)’:
main.cpp:2840:10: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying as many bytes from a string as its length
This patch addresses this issue.
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
The parse_paramter loop iterates over a parameter.txt file's contents
and parses that line-by-line. However, the current implementation
silently stops after parsing 'mtdparts'. This is problematic if
a 'uuid' token is found in one of the following lines.
This patch addresses the problem, by simply continue to iterate
over the next lines after 'mtdparts'.
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
ERROR:
main.cpp:2841:10: error: ‘char* strncpy(char*, const char*, size_t)’
output truncated before terminating nul copying as many bytes from
a string as its length [-Werror=stringop-truncation]
Since the allocation is only 100*char, the reasonable fix would be
limit the strncpy to only (100-1)*char.
2019-02-23 22:26:27 +08:00
Open Source Software for Rockchip SoCs(moved to https://github.com/rockchip-linux/)
1.add LD to list devices
2.add PRM to write parameter
3.change PGPT to PPT to support print parameter and GPT
Signed-off-by: liuyi <liuyi@rock-chips.com>
The index needѕ to be incremented after a valid path was found. Otherwise
gOpts.loader[index].name will be out of of bound after the second
iteration.
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
uiSupportType is type uint. emUsbType defaults to int.
A logical OR will result in a uint. Therefore cast emUsbType
to uint to prevent following error with clang on OpenBSD
cc1plus: warnings being treated as errors
main.cpp: In function 'bool check_device_type(STRUCT_RKDEVICE_DESC&, UINT)':
main.cpp:835: warning: comparison between signed and unsigned integer expressions
*** Error 1 in . (Makefile:461 'main.o')
*** Error 1 in /root/rkdeveloptool (Makefile:506 'all-recursive')
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
OpenBSD bsdmake does not define $(RM) like GNU Make.
As it's highly unlikely that anyone will ever want to override rm or has
as system where rm is not in the path, let us just use the command
directly for the sake of simplicity.
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
On OpenBSD iconv headers were not found:
from gcc-local(1) on OpenBSD
gcc does not search under /usr/local for include files nor for
libraries: as a system compiler, it only searches the system paths by
default.
Set CPPFLAGS and LDFLAGS based on os_host set by AC_CANONICAL_HOST.
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
macOS requires -liconv in the LDFLAGS to link correctly. So add a
search macro to the configure script to prevent following error:
g++ -g -O2 -o rkdeveloptool main.o crc.o RKBoot.o RKComm.o RKDevice.o
RKImage.o RKLog.o RKScan.o -L/usr/local/Cellar/libusb/1.0.21/lib -lusb-1.0
Undefined symbols for architecture x86_64:
"_iconv", referenced from:
StringToWideString(char*, wchar_t*&) in main.o
WideStringToString(wchar_t*, char*&) in main.o
"_iconv_close", referenced from:
StringToWideString(char*, wchar_t*&) in main.o
WideStringToString(wchar_t*, char*&) in main.o
"_iconv_open", referenced from:
StringToWideString(char*, wchar_t*&) in main.o
WideStringToString(wchar_t*, char*&) in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [rkdeveloptool] Error 1
Fixes build error with Apple LLVM version 8.1.0 (clang-802.0.42)
main.cpp:1160:18: error: result of comparison against a string literal
is unspecified (use strncmp instead) [-Werror,-Wstring-compare]
if (configPath == (char*)DEF_CONFIG_FILE) {
^~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Add space after comma or colon and before parenthesis and collapse
duplicate space. Don't use parenthesis for progress messages.
Use progressive forms of verbs where suitable.
While at it, replace repetition of function names with macro and rename
one variable.
Signed-off-by: Andreas Färber <afaerber@suse.de>
NORMAL_COLOR_ATTR hardcoded white-on-black text. Fix this to reset to
the actual user-controlled defaults.
This resolves white-on-black text after errors on a black-on-white
terminal (issue #10).
Signed-off-by: Andreas Färber <afaerber@suse.de>
pack and unpack boot loader is very helpful when debug boot loader.
we should support it in rkdeveloptool.
Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>