diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-12-14 10:52:11 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-12-14 10:52:11 +0800 |
commit | 36bfcbab4e0f0e34a1641bb9465300530ccec2e1 (patch) | |
tree | 930162df54571a9c6d9b118536de739f89f2cb74 | |
parent | 9f71692ea70f8eacd50d09abc577482de1e80b28 (diff) | |
download | pttbbs-36bfcbab4e0f0e34a1641bb9465300530ccec2e1.tar pttbbs-36bfcbab4e0f0e34a1641bb9465300530ccec2e1.tar.gz pttbbs-36bfcbab4e0f0e34a1641bb9465300530ccec2e1.tar.bz2 pttbbs-36bfcbab4e0f0e34a1641bb9465300530ccec2e1.tar.lz pttbbs-36bfcbab4e0f0e34a1641bb9465300530ccec2e1.tar.xz pttbbs-36bfcbab4e0f0e34a1641bb9465300530ccec2e1.tar.zst pttbbs-36bfcbab4e0f0e34a1641bb9465300530ccec2e1.zip |
Provide verbose message to check for r5734 upgrade.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5736 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/upgrade/r5734.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pttbbs/upgrade/r5734.c b/pttbbs/upgrade/r5734.c index 65e406d2..b2f95d67 100644 --- a/pttbbs/upgrade/r5734.c +++ b/pttbbs/upgrade/r5734.c @@ -1,10 +1,17 @@ #define _UTIL_C_ #include "bbs.h" -#define CLEAR(x) memset(&(u->x), 0, sizeof(u->x)) +#define CLEAR(x) { \ + for (i = 0; i < sizeof(u->x); i++) \ + if (((char*)&(u->x))[i] != 0) \ + need_clear = 1; \ + memset(&(u->x), 0, sizeof(u->x)); \ +} int check(void *data, int n, userec_t *u) { + int i = 0; + int need_clear = 0; if (!u->userid[0]) return 0; fprintf(stderr, "%d\r", n); @@ -22,8 +29,12 @@ int check(void *data, int n, userec_t *u) CLEAR(_unused10); CLEAR(_unused11); CLEAR(_unused12); + // flush - passwd_update(n+1, u); + if (need_clear) { + printf("Clear: %s\n", u->userid); + passwd_update(n+1, u); + } return 0; } |