summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-06 21:37:08 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-06 21:37:08 +0800
commit66e4d5470f13b816489cea8ec22a7690184b0ae2 (patch)
tree45ee28a8e3f9db3f37e23cc5ea07e49d19734742 /util
parent8d603bc9450a72679e9555fb14f5b27ef46cc113 (diff)
downloadpttbbs-66e4d5470f13b816489cea8ec22a7690184b0ae2.tar
pttbbs-66e4d5470f13b816489cea8ec22a7690184b0ae2.tar.gz
pttbbs-66e4d5470f13b816489cea8ec22a7690184b0ae2.tar.bz2
pttbbs-66e4d5470f13b816489cea8ec22a7690184b0ae2.tar.lz
pttbbs-66e4d5470f13b816489cea8ec22a7690184b0ae2.tar.xz
pttbbs-66e4d5470f13b816489cea8ec22a7690184b0ae2.tar.zst
pttbbs-66e4d5470f13b816489cea8ec22a7690184b0ae2.zip
checkmoney tools
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1710 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r--util/checkmoney.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/util/checkmoney.c b/util/checkmoney.c
new file mode 100644
index 00000000..22170bdb
--- /dev/null
+++ b/util/checkmoney.c
@@ -0,0 +1,27 @@
+/* $Id: checkmoney.c 1645 2004-03-31 01:24:38Z ptt $ */
+#define _UTIL_C_
+#include "bbs.h"
+
+
+int main(int argc, char*argv[]) {
+ userec_t user;
+ char *userid;
+ int i, money;
+
+ if(argc<2)
+ printf("user %s <PASSWD file to compare>", argv[0]);
+ attach_SHM();
+
+ if(passwd_init())
+ exit(1);
+ for(i = 1; i <= MAX_USERS; i++) {
+ userid=SHM->userid[i-1];
+ money =SHM->money[i-1];
+ if(!userid[0]) continue;
+ if(get_record(argv[1], &user, sizeof(user), i) == -1)continue;
+ printf("%s %d %s %d\n", userid, money, user.userid, user.money);
+
+ }
+
+ return 0;
+}