summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorHung-ying Tyan <tyanh@google.com>2009-09-16 15:43:15 +0800
committerHung-ying Tyan <tyanh@google.com>2009-09-17 12:17:29 +0800
commit408c5f2c9846780f05c2a3b3c837fecd5f5c74a6 (patch)
treea29ed8e8f6665a11b07da127aa25c527f2dd5cd5 /cmds
parent5ec064cfce1abbf51dcf1eb8256a66af5aa442f7 (diff)
downloadframeworks_native-408c5f2c9846780f05c2a3b3c837fecd5f5c74a6.zip
frameworks_native-408c5f2c9846780f05c2a3b3c837fecd5f5c74a6.tar.gz
frameworks_native-408c5f2c9846780f05c2a3b3c837fecd5f5c74a6.tar.bz2
Fix a minor bug in is_alnum_string()...
and remove some verbose logging
Diffstat (limited to 'cmds')
-rw-r--r--cmds/keystore/netkeystore.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/cmds/keystore/netkeystore.c b/cmds/keystore/netkeystore.c
index 83c7871..87fdc80 100644
--- a/cmds/keystore/netkeystore.c
+++ b/cmds/keystore/netkeystore.c
@@ -116,10 +116,13 @@ static int parse_strings(char *data, int data_len, int ntokens, ...)
static int is_alnum_string(char *s)
{
+ char *s0 = s;
while (*s != 0) {
- if (!isalnum(*s++)) return 0;
+ if (!isalnum(*s++)) {
+ LOGE("The string '%s' is not an alphanumeric string\n", s0);
+ return 0;
+ }
}
- LOGE("The string %s is not an alphanumeric string\n", s);
return 1;
}
@@ -159,7 +162,9 @@ static void do_unlock(LPC_MARSHAL *cmd, LPC_MARSHAL *reply)
// no argument
static void do_get_state(LPC_MARSHAL *cmd, LPC_MARSHAL *reply)
{
- reply->retcode = get_state();
+ int s = get_state();
+ if (DBG) LOGD("keystore state = %d\n", s);
+ reply->retcode = s;
}
// args of listkeys():
@@ -413,12 +418,10 @@ int server_main(const int argc, const char *argv[])
// read the command, execute and send the result back.
if(read_marshal(s, &cmd)) goto err;
- if (DBG) LOGD("new connection\n");
execute(&cmd, &reply);
write_marshal(s, &reply);
err:
memset(&reply, 0, sizeof(LPC_MARSHAL));
- if (DBG) LOGD("closing connection\n");
close(s);
}