/[LeafOK_CVS]/lbbs/src/article_post.c
ViewVC logotype

Diff of /lbbs/src/article_post.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.8 by sysadm, Sat Jun 14 09:20:13 2025 UTC Revision 1.11 by sysadm, Sat Jun 14 11:59:09 2025 UTC
# Line 731  int article_reply(const SECTION_LIST *p_ Line 731  int article_reply(const SECTION_LIST *p_
731                          memcpy(content + len, content_f + line_offsets[i], (size_t)(line_offsets[i + 1] - line_offsets[i]));                          memcpy(content + len, content_f + line_offsets[i], (size_t)(line_offsets[i + 1] - line_offsets[i]));
732                          len += (line_offsets[i + 1] - line_offsets[i]);                          len += (line_offsets[i + 1] - line_offsets[i]);
733                  }                  }
734                    if (content[len - 1] != '\n') // Appennd \n if not exist
735                    {
736                            content[len] = '\n';
737                            len++;
738                    }
739                  content[len] = '\0';                  content[len] = '\0';
740    
741                  free(content_f);                  free(content_f);
# Line 970  int article_reply(const SECTION_LIST *p_ Line 975  int article_reply(const SECTION_LIST *p_
975          snprintf(sql, sizeof(sql),          snprintf(sql, sizeof(sql),
976                           "INSERT INTO bbs(SID, TID, UID, username, nickname, title, CID, transship, "                           "INSERT INTO bbs(SID, TID, UID, username, nickname, title, CID, transship, "
977                           "sub_dt, sub_ip, reply_note, exp, last_reply_dt, icon, length) "                           "sub_dt, sub_ip, reply_note, exp, last_reply_dt, icon, length) "
978                           "VALUES(%d, 0, %d, '%s', '%s', '%s', %d, 0, NOW(), '%s', 1, %d, NOW(), 1, %ld)",                           "VALUES(%d, %d, %d, '%s', '%s', '%s', %d, 0, NOW(), '%s', 1, %d, NOW(), 1, %ld)",
979                           p_section->sid, BBS_priv.uid, BBS_username, nickname_f, title_f,                           p_section->sid, (p_article->tid == 0 ? p_article->aid : p_article->tid),
980                             BBS_priv.uid, BBS_username, nickname_f, title_f,
981                           p_article_new->cid, hostaddr_client, BBS_user_exp, len_content);                           p_article_new->cid, hostaddr_client, BBS_user_exp, len_content);
982    
983          if (mysql_query(db, sql) != 0)          if (mysql_query(db, sql) != 0)


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1