summaryrefslogtreecommitdiff
path: root/console-tools
diff options
context:
space:
mode:
authorDenis Vlasenko2008-09-18 01:01:02 +0000
committerDenis Vlasenko2008-09-18 01:01:02 +0000
commit72fa70af4c0c46fe2b02d3df27c24ff4d14eb505 (patch)
tree3d2699e9c10af610461fed6a419c8745bb6f196d /console-tools
parent2228426512eabc05767b5abac69770e3ae9cd9bb (diff)
downloadbusybox-72fa70af4c0c46fe2b02d3df27c24ff4d14eb505.zip
busybox-72fa70af4c0c46fe2b02d3df27c24ff4d14eb505.tar.gz
setfont: small fixes from Vladimir
Diffstat (limited to 'console-tools')
-rw-r--r--console-tools/loadfont.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index 38dad3f..4eb88e9 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -233,16 +233,16 @@ int setfont_main(int argc UNUSED_PARAM, char **argv)
fd = xopen(tty_name, O_NONBLOCK);
if (sizeof(CONFIG_DEFAULT_SETFONT_DIR) > 1) { // if not ""
- if (strchr(*argv, '/') != NULL) {
+ if (*argv[0] != '/') {
// goto default fonts location. don't die if doesn't exist
chdir(CONFIG_DEFAULT_SETFONT_DIR "/consolefonts");
- // buglet: we don't return to current dir...
- // affects "setfont FONT -m ./MAP" case
}
}
// load font
len = 32*1024; // can't be larger
psfhdr = (struct psf_header *) xmalloc_open_zipped_read_close(*argv, &len);
+ if (!psfhdr)
+ bb_simple_perror_msg_and_die(*argv);
do_load(fd, psfhdr, len);
// load the screen map, if any
@@ -251,7 +251,7 @@ int setfont_main(int argc UNUSED_PARAM, char **argv)
void *map;
if (sizeof(CONFIG_DEFAULT_SETFONT_DIR) > 1) { // if not ""
- if (strchr(mapfilename, '/') != NULL) {
+ if (mapfilename[0] != '/') {
// goto default keymaps location
chdir(CONFIG_DEFAULT_SETFONT_DIR "/consoletrans");
}