aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrumeet <yuuta@yuuta.moe>2022-11-18 17:38:46 -0800
committerTrumeet <yuuta@yuuta.moe>2022-11-18 17:38:46 -0800
commitd6729a4a29baa5aecfc858388df5b4373916a894 (patch)
tree17be2562a3ae22c709ccb544209c6455ef7d0e9a
parent3ebff2e47ab77a74fd9905896046ef66531b2b14 (diff)
downloadhitokoto-d6729a4a29baa5aecfc858388df5b4373916a894.tar
hitokoto-d6729a4a29baa5aecfc858388df5b4373916a894.tar.gz
hitokoto-d6729a4a29baa5aecfc858388df5b4373916a894.tar.bz2
hitokoto-d6729a4a29baa5aecfc858388df5b4373916a894.zip
Fix error
-rw-r--r--PKGBUILD2
-rw-r--r--m2.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 9f9338d..41aadf3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,7 +11,7 @@ groups=()
depends=(sqlite3 fcgi)
source=("m2.c"
"init.sql")
-sha256sums=('80aa15bca8361fd4430c114be633e024ee10df84e9a2d6b8939c5ab5407eeb38'
+sha256sums=('46edb0078fb53ea6c66e6909795484db7efded7b904a0e4736e90d7c721b2aad'
'e71a00dfb9a2744f482de80e33c02341d6cae19a1f54e53a5346d972bfeff054')
build() {
diff --git a/m2.c b/m2.c
index 6250e23..be250a8 100644
--- a/m2.c
+++ b/m2.c
@@ -25,13 +25,14 @@ static void cleanup(void) {
static int cb(void *dat, int count, char **data, char **columns) {
struct fcgi_env *env = dat;
- if (count != 3) {
+ if (count != 4) {
FCGX_FPrintF(env->out,
"Status: 500 Internal Server Error\r\n"
"Content-type: text/plain\r\n"
"\r\n"
"The database returned %d columns.\n",
count);
+ return 1;
}
FCGX_FPrintF(env->out,
"Content-type: application/json\r\n"