forked from cory/tildefriends
To calculate an ID, take the utf-8 message, convert it to utf-16, and then throw away the high bytes. Of course.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3834 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
25
src/main.c
25
src/main.c
@ -569,20 +569,35 @@ static int _tf_command_check(const char* file, int argc, char* argv[])
|
||||
int extra_count = 0;
|
||||
const char *err = NULL;
|
||||
XOPT_PARSE(file, XOPT_CTX_KEEPFIRST | XOPT_CTX_STRICT, options, &args, argc, (const char**)argv, &extra_count, &extras, &err, stderr, "post [options]", "options:", NULL, 15);
|
||||
if (extras)
|
||||
{
|
||||
free((void*)extras);
|
||||
}
|
||||
if (err)
|
||||
{
|
||||
if (extras)
|
||||
{
|
||||
free((void*)extras);
|
||||
}
|
||||
fprintf(stderr, "Error: %s\n", err);
|
||||
return 2;
|
||||
}
|
||||
|
||||
bool result = true;
|
||||
sqlite3* db = NULL;
|
||||
sqlite3_open("db.sqlite", &db);
|
||||
bool result = tf_ssb_db_check(db);
|
||||
if (extra_count)
|
||||
{
|
||||
for (int i = 0; i < extra_count; i++)
|
||||
{
|
||||
result = result && tf_ssb_db_check(db, extras[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = tf_ssb_db_check(db, NULL);
|
||||
}
|
||||
sqlite3_close(db);
|
||||
if (extras)
|
||||
{
|
||||
free((void*)extras);
|
||||
}
|
||||
return result ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
||||
xopt_help:
|
||||
|
Reference in New Issue
Block a user