aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2020-10-13 00:04:14 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2020-10-13 00:04:14 +0200
commit39986b29f34795d346b8feb10ce4fe9caac8878e (patch)
tree07f7d4332b0766133040198ca68aa997c1080146 /src
parenta18fa78b7574c0d165ff3e3c09b8f2c67b1901ac (diff)
downloadblogc-39986b29f34795d346b8feb10ce4fe9caac8878e.tar.gz
blogc-39986b29f34795d346b8feb10ce4fe9caac8878e.tar.bz2
blogc-39986b29f34795d346b8feb10ce4fe9caac8878e.zip
blogc: fix post sorting when mixing posts before and after `Sun Sep 9 01:46:40 AM UTC 2001`
Diffstat (limited to 'src')
-rw-r--r--src/blogc/loader.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/blogc/loader.c b/src/blogc/loader.c
index 4e03ec3..af30a1b 100644
--- a/src/blogc/loader.c
+++ b/src/blogc/loader.c
@@ -121,7 +121,10 @@ sort_source(const void *a, const void *b)
return 0; // wat
}
- return strcmp(cb, ca);
+ unsigned long la = strtoul(ca, NULL, 10);
+ unsigned long lb = strtoul(cb, NULL, 10);
+
+ return (int) (lb - la);
}