Skip to content

Commit

Permalink
修正 time_t 的输出方式
Browse files Browse the repository at this point in the history
  • Loading branch information
IronBlood committed Oct 12, 2014
1 parent a981004 commit 63ade3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions libythtbbs/article.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ char *
fh2fname(struct fileheader *fh)
{
static char s[16];
sprintf(s, "M.%d.A", fh->filetime);
sprintf(s, "M.%lu.A", (long)fh->filetime);
if (fh->accessed & FH_ISDIGEST)
s[0] = 'G';
if (fh->accessed & FILE_ISTOP1) //add by wjbta
Expand Down Expand Up @@ -590,7 +590,7 @@ static int update_article_link_in_file(char *boardname, int oldthread, int newfi
time_t fn2timestamp(char * filename) {
char num_str[11]={'0'};
memcpy(num_str, &filename[2], 10);
return (time_t)atoi(num_str);
return (time_t)atol(num_str);
}

int parse_mentions(char *content, char userids[20][14], int from)
Expand Down
12 changes: 6 additions & 6 deletions libythtbbs/article.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ struct fileheader {
#define FH_ISWATER 0x00100000 //判断是否被标注为水文

struct bknheader {
int filetime;
time_t filetime;
char boardname[20];
char title[60];
char unused[44];
};

struct boardtop {
char title[60];
int unum;
int thread;
char firstowner[14];
int lasttime;
char title[60];
int unum;
int thread;
char firstowner[14];
int lasttime;
char board[24];
};

Expand Down

0 comments on commit 63ade3d

Please sign in to comment.