Refactoring!
This commit is contained in:
parent
8d829c2ed2
commit
717827510e
@ -272,9 +272,9 @@ void AreaList::WriteAreaDef(const char* file)
|
|||||||
if(strchr((*aa)->path(), ' '))
|
if(strchr((*aa)->path(), ' '))
|
||||||
tmp += 2;
|
tmp += 2;
|
||||||
maxpath = MaxV(maxpath, tmp);
|
maxpath = MaxV(maxpath, tmp);
|
||||||
if((*aa)->groupid() & 0x8000u)
|
if ((*aa)->groupid() & 0x8000u)
|
||||||
sprintf(groupid, "#%u", (*aa)->groupid()&0x7FFF);
|
gsprintf(PRINTF_DECLARE_BUFFER(groupid), "#%u", (*aa)->groupid()&0x7FFF);
|
||||||
else if(g_isupper((*aa)->groupid()))
|
else if (g_isupper((*aa)->groupid()))
|
||||||
*groupid = (char)(*aa)->groupid(), groupid[1] = NUL;
|
*groupid = (char)(*aa)->groupid(), groupid[1] = NUL;
|
||||||
else
|
else
|
||||||
*groupid = '0', groupid[1] = NUL;
|
*groupid = '0', groupid[1] = NUL;
|
||||||
@ -290,11 +290,12 @@ void AreaList::WriteAreaDef(const char* file)
|
|||||||
maxattr = MaxV(maxattr, tmp+2);
|
maxattr = MaxV(maxattr, tmp+2);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(aa = idx.begin(); aa != idx.end(); aa++) {
|
for (aa = idx.begin(); aa != idx.end(); aa++)
|
||||||
sprintf(desc, "\"%s\"", (*aa)->desc());
|
{
|
||||||
if((*aa)->groupid() & 0x8000u)
|
gsprintf(PRINTF_DECLARE_BUFFER(desc), "\"%s\"", (*aa)->desc());
|
||||||
sprintf(groupid, "#%u", (*aa)->groupid()&0x7FFF);
|
if ((*aa)->groupid() & 0x8000u)
|
||||||
else if(g_isupper((*aa)->groupid()))
|
gsprintf(PRINTF_DECLARE_BUFFER(groupid), "#%u", (*aa)->groupid()&0x7FFF);
|
||||||
|
else if (g_isupper((*aa)->groupid()))
|
||||||
*groupid = (char)(*aa)->groupid(), groupid[1] = NUL;
|
*groupid = (char)(*aa)->groupid(), groupid[1] = NUL;
|
||||||
else
|
else
|
||||||
*groupid = '0', groupid[1] = NUL;
|
*groupid = '0', groupid[1] = NUL;
|
||||||
@ -314,8 +315,8 @@ void AreaList::WriteAreaDef(const char* file)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
strxcpy(msgbase, (*aa)->basetype(), sizeof(msgbase));
|
strxcpy(msgbase, (*aa)->basetype(), sizeof(msgbase));
|
||||||
if(strchr((*aa)->echoid(), ' '))
|
if (strchr((*aa)->echoid(), ' '))
|
||||||
sprintf(echoid, "\"%s\"", (*aa)->echoid());
|
gsprintf(PRINTF_DECLARE_BUFFER(echoid), "\"%s\"", (*aa)->echoid());
|
||||||
else
|
else
|
||||||
strcpy(echoid, (*aa)->echoid());
|
strcpy(echoid, (*aa)->echoid());
|
||||||
if ((*aa)->isseparator())
|
if ((*aa)->isseparator())
|
||||||
@ -327,9 +328,10 @@ void AreaList::WriteAreaDef(const char* file)
|
|||||||
strtrim(type)
|
strtrim(type)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
if(strchr((*aa)->path(), ' '))
|
{
|
||||||
sprintf(path, "\"%s\"", (*aa)->path());
|
if (strchr((*aa)->path(), ' '))
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(path), "\"%s\"", (*aa)->path());
|
||||||
else
|
else
|
||||||
strcpy(path, (*aa)->path());
|
strcpy(path, (*aa)->path());
|
||||||
if(memcmp(&(*aa)->aka(), &CFG->aka[0], sizeof(Addr)))
|
if(memcmp(&(*aa)->aka(), &CFG->aka[0], sizeof(Addr)))
|
||||||
@ -339,8 +341,8 @@ void AreaList::WriteAreaDef(const char* file)
|
|||||||
*attr = '('; /*)*/
|
*attr = '('; /*)*/
|
||||||
MakeAttrStr(attr+1, sizeof(attr)-2, &(*aa)->attr());
|
MakeAttrStr(attr+1, sizeof(attr)-2, &(*aa)->attr());
|
||||||
strcat(attr, /*(*/ ")");
|
strcat(attr, /*(*/ ")");
|
||||||
if((*aa)->originno())
|
if ((*aa)->originno())
|
||||||
sprintf(origin, " \"%.*s\"", (int)sizeof(origin)-4, CFG->origin[(*aa)->originno()].c_str());
|
gsprintf(PRINTF_DECLARE_BUFFER(origin), " \"%.*s\"", (int)sizeof(origin)-4, CFG->origin[(*aa)->originno()].c_str());
|
||||||
else
|
else
|
||||||
*origin = NUL;
|
*origin = NUL;
|
||||||
fp.Printf("AREADEF %-*s %-*s %*s %s %s %-*s %-*s %-*s%s\n",
|
fp.Printf("AREADEF %-*s %-*s %*s %s %s %-*s %-*s %-*s%s\n",
|
||||||
@ -404,4 +406,3 @@ void PcbAdjustArea(uint rec, const char* msgfile) {
|
|||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -174,25 +174,28 @@ void AreaList::AddNewArea(AreaCfg* aa)
|
|||||||
strschg_environ(aa->path);
|
strschg_environ(aa->path);
|
||||||
}
|
}
|
||||||
#ifndef GMB_NOHUDS
|
#ifndef GMB_NOHUDS
|
||||||
else if(streql(aa->basetype, "HUDSON")) {
|
else if (streql(aa->basetype, "HUDSON"))
|
||||||
if((aa->board < 1) or (aa->board > 200)) // Ignore areas with invalid numbers
|
{
|
||||||
|
if ((aa->board < 1) or (aa->board > 200)) // Ignore areas with invalid numbers
|
||||||
return;
|
return;
|
||||||
sprintf(aa->path, "%u", aa->board);
|
gsprintf(PRINTF_DECLARE_BUFFER(aa->path), "%u", aa->board);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef GMB_NOGOLD
|
#ifndef GMB_NOGOLD
|
||||||
else if(streql(aa->basetype, "GOLDBASE")) {
|
else if (streql(aa->basetype, "GOLDBASE"))
|
||||||
if((aa->board < 1) or (aa->board > 500)) // Ignore areas with invalid numbers
|
{
|
||||||
|
if ((aa->board < 1) or (aa->board > 500)) // Ignore areas with invalid numbers
|
||||||
return;
|
return;
|
||||||
sprintf(aa->path, "%u", aa->board);
|
gsprintf(PRINTF_DECLARE_BUFFER(aa->path), "%u", aa->board);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef GMB_NOEZY
|
#ifndef GMB_NOEZY
|
||||||
else if(streql(aa->basetype, "EZYCOM")) {
|
else if (streql(aa->basetype, "EZYCOM"))
|
||||||
|
{
|
||||||
// Ignore areas with invalid numbers
|
// Ignore areas with invalid numbers
|
||||||
if((aa->board < 1) or (aa->board > 1536))
|
if ((aa->board < 1) or (aa->board > 1536))
|
||||||
return;
|
return;
|
||||||
sprintf(aa->path, "%u", aa->board);
|
gsprintf(PRINTF_DECLARE_BUFFER(aa->path), "%u", aa->board);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef GMB_NOWCAT
|
#ifndef GMB_NOWCAT
|
||||||
|
@ -686,8 +686,8 @@ CfgGed::CfgGed() {
|
|||||||
*searchfor = 0;
|
*searchfor = 0;
|
||||||
strcpy(stylecodepunct, " !?\"$%&()+,.:;<=>@[\\]^`{|}~\n\r\t");
|
strcpy(stylecodepunct, " !?\"$%&()+,.:;<=>@[\\]^`{|}~\n\r\t");
|
||||||
*stylecodestops = 0;
|
*stylecodestops = 0;
|
||||||
sprintf(tasktitle, "%s%s%s%s", __gver_prename__, __gver_name__,
|
gsprintf(PRINTF_DECLARE_BUFFER(tasktitle), "%s%s%s%s", __gver_prename__,
|
||||||
__gver_postname__, __gver_platform__);
|
__gver_name__, __gver_postname__, __gver_platform__);
|
||||||
strcpy(tearline, "@longpid @version");
|
strcpy(tearline, "@longpid @version");
|
||||||
strcpy(whoto, "All");
|
strcpy(whoto, "All");
|
||||||
strcpy(xlatlocalset, get_charset());
|
strcpy(xlatlocalset, get_charset());
|
||||||
|
@ -824,7 +824,7 @@ int ReadCfg(const char* cfgfile, int ignoreunknown)
|
|||||||
if (veryverbose)
|
if (veryverbose)
|
||||||
{
|
{
|
||||||
char buff[256];
|
char buff[256];
|
||||||
sprintf(buff, " %c %04d: %s %s\n", cfgignore ? '-' : '+', line, key, val);
|
gsprintf(PRINTF_DECLARE_BUFFER(buff), " %c %04d: %s %s\n", cfgignore ? '-' : '+', line, key, val);
|
||||||
STD_PRINT(buff);
|
STD_PRINT(buff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -672,8 +672,11 @@ void ReadXlatTables()
|
|||||||
strcpy(ChsTable.imp, strbtrim(ptr));
|
strcpy(ChsTable.imp, strbtrim(ptr));
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
if(ChsTable.level)
|
if (ChsTable.level)
|
||||||
sprintf(ChsTable.exp, "%s %d", strbtrim(ptr), ChsTable.level);
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(ChsTable.exp), "%s %d",
|
||||||
|
strbtrim(ptr), ChsTable.level);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
strcpy(ChsTable.exp, strbtrim(ptr));
|
strcpy(ChsTable.exp, strbtrim(ptr));
|
||||||
break;
|
break;
|
||||||
@ -848,4 +851,3 @@ void CookieIndex(char* textfile, char* indexfile)
|
|||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ void GPickArealist::dispbuf(char* buf, int areano) {
|
|||||||
buf[MAXCOL-2] = NUL;
|
buf[MAXCOL-2] = NUL;
|
||||||
|
|
||||||
char areabuf[33];
|
char areabuf[33];
|
||||||
sprintf(areabuf, "%u", CFG->switches.get(arealistnos) ? area->board() : areanumbers[areano]);
|
gsprintf(PRINTF_DECLARE_BUFFER(areabuf), "%u", CFG->switches.get(arealistnos) ? area->board() : areanumbers[areano]);
|
||||||
int areawidth = strlen(areabuf);
|
int areawidth = strlen(areabuf);
|
||||||
|
|
||||||
char markedbuf[2] = { " " };
|
char markedbuf[2] = { " " };
|
||||||
@ -163,8 +163,8 @@ void GPickArealist::dispbuf(char* buf, int areano) {
|
|||||||
int descwidth = strlen(strcpy(descbuf, area->desc()));
|
int descwidth = strlen(strcpy(descbuf, area->desc()));
|
||||||
|
|
||||||
char countbuf[33];
|
char countbuf[33];
|
||||||
if(area->isscanned)
|
if (area->isscanned)
|
||||||
sprintf(countbuf, "%u", (uint)area->Msgn.Count());
|
gsprintf(PRINTF_DECLARE_BUFFER(countbuf), "%u", (uint)area->Msgn.Count());
|
||||||
else
|
else
|
||||||
strcpy(countbuf, "-");
|
strcpy(countbuf, "-");
|
||||||
int countwidth = strlen(countbuf);
|
int countwidth = strlen(countbuf);
|
||||||
@ -174,8 +174,8 @@ void GPickArealist::dispbuf(char* buf, int areano) {
|
|||||||
int pmarkwidth = 1;
|
int pmarkwidth = 1;
|
||||||
|
|
||||||
char unreadbuf[33];
|
char unreadbuf[33];
|
||||||
if(area->isscanned)
|
if (area->isscanned)
|
||||||
sprintf(unreadbuf, "%u", (uint)((CFG->arealisttype == AL_TOTNEW) ? area->unread : area->lastread()));
|
gsprintf(PRINTF_DECLARE_BUFFER(unreadbuf), "%u", (uint)((CFG->arealisttype == AL_TOTNEW) ? area->unread : area->lastread()));
|
||||||
else
|
else
|
||||||
strcpy(unreadbuf, "-");
|
strcpy(unreadbuf, "-");
|
||||||
int unreadwidth = strlen(unreadbuf);
|
int unreadwidth = strlen(unreadbuf);
|
||||||
@ -188,13 +188,15 @@ void GPickArealist::dispbuf(char* buf, int areano) {
|
|||||||
int echoidwidth = strlen(strcpy(echoidbuf, area->echoid()));
|
int echoidwidth = strlen(strcpy(echoidbuf, area->echoid()));
|
||||||
|
|
||||||
char groupidbuf[10] = { "" };
|
char groupidbuf[10] = { "" };
|
||||||
if(groupid_width) {
|
if (groupid_width)
|
||||||
if(area->groupid() & 0x8000u) {
|
{
|
||||||
if(groupid_width > 2)
|
if (area->groupid() & 0x8000u)
|
||||||
sprintf(groupidbuf, "%u", area->groupid()&0x7FFF);
|
{
|
||||||
|
if (groupid_width > 2)
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(groupidbuf), "%u", area->groupid()&0x7FFF);
|
||||||
}
|
}
|
||||||
else if(g_isupper(area->groupid()))
|
else if (g_isupper(area->groupid()))
|
||||||
sprintf(groupidbuf, "%c", (char)area->groupid());
|
gsprintf(PRINTF_DECLARE_BUFFER(groupidbuf), "%c", (char)area->groupid());
|
||||||
}
|
}
|
||||||
int groupidwidth = strlen(groupidbuf);
|
int groupidwidth = strlen(groupidbuf);
|
||||||
|
|
||||||
@ -501,7 +503,7 @@ void GPickArealist::AreaDropMsgMarks(uint n) {
|
|||||||
nummarks += (*AL.item)->Mark.Count();
|
nummarks += (*AL.item)->Mark.Count();
|
||||||
|
|
||||||
char buf[256];
|
char buf[256];
|
||||||
sprintf(buf, LNG->DropMarksInfo, longdotstr(nummarks));
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), LNG->DropMarksInfo, longdotstr(nummarks));
|
||||||
|
|
||||||
w_info(buf);
|
w_info(buf);
|
||||||
int mode = MenuAreaDropMarks.Run();
|
int mode = MenuAreaDropMarks.Run();
|
||||||
|
@ -209,27 +209,33 @@ int DoCarboncopy(GMsg* msg, GMsg** carbon) {
|
|||||||
break;
|
break;
|
||||||
case CC_HIDDEN:
|
case CC_HIDDEN:
|
||||||
ccline = msg->lin;
|
ccline = msg->lin;
|
||||||
if(A == AA) {
|
if (A == AA)
|
||||||
sprintf(buf, "\001CC: %s %s", msg->To(), msg->dest.make_string(temp).c_str());
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "\001CC: %s %s", msg->To(), msg->dest.make_string(temp).c_str());
|
||||||
ccline = AddKludge(ccline, buf);
|
ccline = AddKludge(ccline, buf);
|
||||||
}
|
}
|
||||||
for(n=0; n<cc; n++) {
|
for (n=0; n<cc; n++)
|
||||||
if((*carbon)[n].attr.tou()) {
|
{
|
||||||
sprintf(buf, "\001CC: %s %s", (*carbon)[n].To(), (*carbon)[n].dest.make_string(temp).c_str());
|
if ((*carbon)[n].attr.tou())
|
||||||
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "\001CC: %s %s", (*carbon)[n].To(), (*carbon)[n].dest.make_string(temp).c_str());
|
||||||
ccline = AddKludge(ccline, buf);
|
ccline = AddKludge(ccline, buf);
|
||||||
(*carbon)[n].attr.tou0();
|
(*carbon)[n].attr.tou0();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CC_VISIBLE:
|
case CC_VISIBLE:
|
||||||
sprintf(buf2, LNG->CCTo, LNG->ListCC);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf2), LNG->CCTo, LNG->ListCC);
|
||||||
if(A == AA) {
|
if (A == AA)
|
||||||
sprintf(buf, buf2, msg->To(), msg->dest.make_string(temp).c_str());
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), buf2, msg->To(), msg->dest.make_string(temp).c_str());
|
||||||
ccline = AddLine(ccline, buf);
|
ccline = AddLine(ccline, buf);
|
||||||
}
|
}
|
||||||
for(n=0; n<cc; n++) {
|
for (n = 0; n < cc; n++)
|
||||||
if((*carbon)[n].attr.tou()) {
|
{
|
||||||
sprintf(buf, buf2, (*carbon)[n].To(), (*carbon)[n].dest.make_string(temp).c_str());
|
if ((*carbon)[n].attr.tou())
|
||||||
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), buf2, (*carbon)[n].To(), (*carbon)[n].dest.make_string(temp).c_str());
|
||||||
ccline = AddLine(ccline, buf);
|
ccline = AddLine(ccline, buf);
|
||||||
(*carbon)[n].attr.tou0();
|
(*carbon)[n].attr.tou0();
|
||||||
}
|
}
|
||||||
@ -247,24 +253,28 @@ int DoCarboncopy(GMsg* msg, GMsg** carbon) {
|
|||||||
hline += msg->To();
|
hline += msg->To();
|
||||||
++line_items;
|
++line_items;
|
||||||
}
|
}
|
||||||
for(n=0; n < cc; n++) {
|
for (n = 0; n < cc; n++)
|
||||||
if((*carbon)[n].attr.tou()) {
|
{
|
||||||
|
if ((*carbon)[n].attr.tou())
|
||||||
|
{
|
||||||
const char *user = (*carbon)[n].To();
|
const char *user = (*carbon)[n].To();
|
||||||
if((hline.length() + strlen(user) + 2 > margintext) and line_items) {
|
if ((hline.length() + strlen(user) + 2 > margintext) and line_items)
|
||||||
sprintf(buf, LNG->CCTo, hline.c_str());
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), LNG->CCTo, hline.c_str());
|
||||||
ccline = AddLine(ccline, buf);
|
ccline = AddLine(ccline, buf);
|
||||||
line_items = 0;
|
line_items = 0;
|
||||||
hline = "";
|
hline = "";
|
||||||
}
|
}
|
||||||
if(line_items != 0)
|
if (line_items != 0)
|
||||||
hline += ", ";
|
hline += ", ";
|
||||||
hline += user;
|
hline += user;
|
||||||
++line_items;
|
++line_items;
|
||||||
(*carbon)[n].attr.tou0();
|
(*carbon)[n].attr.tou0();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(line_items) {
|
if (line_items)
|
||||||
sprintf(buf, LNG->CCTo, hline.c_str());
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), LNG->CCTo, hline.c_str());
|
||||||
ccline = AddLine(ccline, buf);
|
ccline = AddLine(ccline, buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -427,8 +437,9 @@ void DoCrosspost(GMsg* msg, std::vector<int> &postareas) {
|
|||||||
case CC_VISIBLE:
|
case CC_VISIBLE:
|
||||||
// Expand in line
|
// Expand in line
|
||||||
{
|
{
|
||||||
if(not hideoriginal) {
|
if (not hideoriginal)
|
||||||
sprintf(buf, LNG->Originallyin, AA->echoid());
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), LNG->Originallyin, AA->echoid());
|
||||||
xcline = AddLine(xcline, buf);
|
xcline = AddLine(xcline, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,8 +450,9 @@ void DoCrosspost(GMsg* msg, std::vector<int> &postareas) {
|
|||||||
const char *echoid = AL[postareas[i]]->echoid();
|
const char *echoid = AL[postareas[i]]->echoid();
|
||||||
if(postareas_attrs[i] or strieql(AA->echoid(), echoid))
|
if(postareas_attrs[i] or strieql(AA->echoid(), echoid))
|
||||||
continue;
|
continue;
|
||||||
if((hline.length() + strlen(echoid) + 2 > margintext) and line_items) {
|
if ((hline.length() + strlen(echoid) + 2 > margintext) and line_items)
|
||||||
sprintf(buf, LNG->Crosspostedin, hline.c_str());
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), LNG->Crosspostedin, hline.c_str());
|
||||||
xcline = AddLine(xcline, buf);
|
xcline = AddLine(xcline, buf);
|
||||||
line_items = 0;
|
line_items = 0;
|
||||||
hline = "";
|
hline = "";
|
||||||
@ -450,24 +462,27 @@ void DoCrosspost(GMsg* msg, std::vector<int> &postareas) {
|
|||||||
hline += echoid;
|
hline += echoid;
|
||||||
++line_items;
|
++line_items;
|
||||||
}
|
}
|
||||||
if(line_items) {
|
if (line_items)
|
||||||
sprintf(buf, LNG->Crosspostedin, hline.c_str());
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), LNG->Crosspostedin, hline.c_str());
|
||||||
xcline = AddLine(xcline, buf);
|
xcline = AddLine(xcline, buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CC_NAMES:
|
case CC_NAMES:
|
||||||
// Expand in column
|
// Expand in column
|
||||||
if(not hideoriginal) {
|
if (not hideoriginal)
|
||||||
sprintf(buf, LNG->Originallyin, AA->echoid());
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), LNG->Originallyin, AA->echoid());
|
||||||
xcline = AddLine(xcline, buf);
|
xcline = AddLine(xcline, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i=local_xps; i < postareas.size(); i++) {
|
for (int i = local_xps; i < postareas.size(); i++)
|
||||||
|
{
|
||||||
const char *echoid = AL[postareas[i]]->echoid();
|
const char *echoid = AL[postareas[i]]->echoid();
|
||||||
if(postareas_attrs[i] or strieql(AA->echoid(), echoid))
|
if (postareas_attrs[i] or strieql(AA->echoid(), echoid))
|
||||||
continue;
|
continue;
|
||||||
sprintf(buf, LNG->Crosspostedin, echoid);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), LNG->Crosspostedin, echoid);
|
||||||
xcline = AddLine(xcline, buf);
|
xcline = AddLine(xcline, buf);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -581,10 +581,11 @@ void CmfMsgs(GMsg* msg, bool torecycle)
|
|||||||
if(need_netmail_kludges) {
|
if(need_netmail_kludges) {
|
||||||
char buf[256] = "";
|
char buf[256] = "";
|
||||||
|
|
||||||
if(not strstr(msg->txt, "\001INTL"))
|
if (not strstr(msg->txt, "\001INTL"))
|
||||||
// The INTL kludge for zone crossing
|
// The INTL kludge for zone crossing
|
||||||
if(CFG->useintl and (CFG->useintl == YES or (msg->dest.zone != msg->orig.zone))) {
|
if (CFG->useintl and (CFG->useintl == YES or (msg->dest.zone != msg->orig.zone)))
|
||||||
sprintf(buf, "\001INTL %u:%u/%u %u:%u/%u%c",
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "\001INTL %u:%u/%u %u:%u/%u%c",
|
||||||
msg->dest.zone ? msg->dest.zone : AA->Aka().addr.zone,
|
msg->dest.zone ? msg->dest.zone : AA->Aka().addr.zone,
|
||||||
msg->dest.net, msg->dest.node,
|
msg->dest.net, msg->dest.node,
|
||||||
msg->orig.zone ? msg->orig.zone : AA->Aka().addr.zone,
|
msg->orig.zone ? msg->orig.zone : AA->Aka().addr.zone,
|
||||||
|
@ -73,7 +73,7 @@ char* MakeOrigin(GMsg* msg, const char* orig) {
|
|||||||
if(*origin == '@')
|
if(*origin == '@')
|
||||||
GetRandomLine(origin, sizeof(origin), origin+1);
|
GetRandomLine(origin, sizeof(origin), origin+1);
|
||||||
|
|
||||||
sprintf(msg->origin, "%.*s (%s)", (int)(79 - 11 - 2 - strlen(buf) - 1), origin, buf);
|
gsprintf(PRINTF_DECLARE_BUFFER(msg->origin), "%.*s (%s)", (int)(79 - 11 - 2 - strlen(buf) - 1), origin, buf);
|
||||||
return msg->origin;
|
return msg->origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,12 +231,16 @@ const char* get_informative_string(void) {
|
|||||||
|
|
||||||
static char informative_string[356] = "";
|
static char informative_string[356] = "";
|
||||||
|
|
||||||
if(informative_string[0] == NUL)
|
if (informative_string[0] == NUL)
|
||||||
sprintf(informative_string, "%s%s%s%s %s%i.%i.%i%s (%s)",
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(informative_string),
|
||||||
|
"%s%s%s%s %s%i.%i.%i%s (%s)",
|
||||||
__gver_prename__, __gver_name__, __gver_postname__,
|
__gver_prename__, __gver_name__, __gver_postname__,
|
||||||
__gver_platform__, __gver_preversion__, __gver_major__,
|
__gver_platform__, __gver_preversion__, __gver_major__,
|
||||||
__gver_minor__, __gver_release__, __gver_postversion__,
|
__gver_minor__, __gver_release__, __gver_postversion__,
|
||||||
ggetosstring());
|
ggetosstring());
|
||||||
|
}
|
||||||
|
|
||||||
return informative_string;
|
return informative_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,9 +355,10 @@ void DoKludges(int mode, GMsg* msg, int kludges) {
|
|||||||
CvtMessageIDtoMSGID(buf2, buf, AA->echoid(), "MSGID");
|
CvtMessageIDtoMSGID(buf2, buf, AA->echoid(), "MSGID");
|
||||||
strcpy(msg->msgids, buf+8);
|
strcpy(msg->msgids, buf+8);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
msg->orig.make_string(buf2, msg->odom);
|
msg->orig.make_string(buf2, msg->odom);
|
||||||
sprintf(msg->msgids, "%s %08x", buf2, getMsgId());
|
gsprintf(PRINTF_DECLARE_BUFFER(msg->msgids), "%s %08x", buf2, getMsgId());
|
||||||
}
|
}
|
||||||
if(CFG->switches.get(usemsgid) and strcmp(AA->basetype(), "PCBOARD")) {
|
if(CFG->switches.get(usemsgid) and strcmp(AA->basetype(), "PCBOARD")) {
|
||||||
sprintf(buf, "\001MSGID: %s", msg->msgids);
|
sprintf(buf, "\001MSGID: %s", msg->msgids);
|
||||||
@ -796,8 +801,9 @@ void DoTearorig(int mode, GMsg* msg) {
|
|||||||
TokenXlat(mode, msg->origin, sizeof(msg->origin), msg, msg, CurrArea);
|
TokenXlat(mode, msg->origin, sizeof(msg->origin), msg, msg, CurrArea);
|
||||||
|
|
||||||
// Add the tagline, tearline and origin as defined
|
// Add the tagline, tearline and origin as defined
|
||||||
if(AA->Taglinesupport() and *msg->tagline) {
|
if (AA->Taglinesupport() and *msg->tagline)
|
||||||
sprintf(buf, "%c%c%c %s", AA->Taglinechar(), AA->Taglinechar(), AA->Taglinechar(), msg->tagline);
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%c%c%c %s", AA->Taglinechar(), AA->Taglinechar(), AA->Taglinechar(), msg->tagline);
|
||||||
strtrim(buf);
|
strtrim(buf);
|
||||||
line = AddLine(line, buf);
|
line = AddLine(line, buf);
|
||||||
line->type |= GLINE_TAGL;
|
line->type |= GLINE_TAGL;
|
||||||
@ -806,8 +812,9 @@ void DoTearorig(int mode, GMsg* msg) {
|
|||||||
line = AddLine(line, MakeTearline(msg, buf));
|
line = AddLine(line, MakeTearline(msg, buf));
|
||||||
line->type |= GLINE_TEAR;
|
line->type |= GLINE_TEAR;
|
||||||
}
|
}
|
||||||
if(ctrlinfo & CI_ORIG) {
|
if (ctrlinfo & CI_ORIG)
|
||||||
sprintf(buf, " * Origin: %s", msg->origin);
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), " * Origin: %s", msg->origin);
|
||||||
line = AddLine(line, buf);
|
line = AddLine(line, buf);
|
||||||
line->type |= GLINE_ORIG;
|
line->type |= GLINE_ORIG;
|
||||||
}
|
}
|
||||||
|
@ -140,9 +140,10 @@ void SaveLines(int mode, const char* savefile, GMsg* msg, int margin, bool clip)
|
|||||||
throw_release(msg->txt);
|
throw_release(msg->txt);
|
||||||
msg->txt = old_msg_txt;
|
msg->txt = old_msg_txt;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
sprintf(buf, LNG->CouldNotOpen, fnam);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), LNG->CouldNotOpen, fnam);
|
||||||
w_info(buf);
|
w_info(buf);
|
||||||
waitkeyt(10000);
|
waitkeyt(10000);
|
||||||
w_info(NULL);
|
w_info(NULL);
|
||||||
@ -288,7 +289,7 @@ static void WriteMsgs(GMsg* msg) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sprintf(buf, LNG->WritingFile, AA->Outputfile());
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), LNG->WritingFile, AA->Outputfile());
|
||||||
w_info(buf);
|
w_info(buf);
|
||||||
AA->LoadMsg(msg, msg->msgno, prnmargin);
|
AA->LoadMsg(msg, msg->msgno, prnmargin);
|
||||||
SaveLines(overwrite ? MODE_WRITE : MODE_APPEND, AA->Outputfile(), msg, prnmargin);
|
SaveLines(overwrite ? MODE_WRITE : MODE_APPEND, AA->Outputfile(), msg, prnmargin);
|
||||||
|
@ -267,10 +267,12 @@ int ShellToDos(const char* command, char* message, vattr cls, int cursor, int pa
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
int envn = 0;
|
int envn = 0;
|
||||||
while(environ[envn] and *environ[envn]) {
|
while (environ[envn] and *environ[envn])
|
||||||
if(strnieql(environ[envn], "PROMPT=", 7)) {
|
{
|
||||||
|
if (strnieql(environ[envn], "PROMPT=", 7))
|
||||||
|
{
|
||||||
strcpy(oldprompt, environ[envn]);
|
strcpy(oldprompt, environ[envn]);
|
||||||
sprintf(prompt, "PROMPT=%s%s", LNG->Prompt, *oldprompt ? oldprompt+7 : "");
|
gsprintf(PRINTF_DECLARE_BUFFER(prompt), "PROMPT=%s%s", LNG->Prompt, *oldprompt ? oldprompt+7 : "");
|
||||||
environ[envn] = prompt;
|
environ[envn] = prompt;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1324,7 +1324,7 @@ void IEclass::SpellCheck()
|
|||||||
strcpy(_buf2, AddPath(CFG->goldpath, EDIT->File()));
|
strcpy(_buf2, AddPath(CFG->goldpath, EDIT->File()));
|
||||||
strchg(_buf2, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
|
strchg(_buf2, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
|
||||||
strischg(_buf, "@file", _buf2);
|
strischg(_buf, "@file", _buf2);
|
||||||
sprintf(_buf2, LNG->SpellChecker, _buf);
|
gsprintf(PRINTF_DECLARE_BUFFER(_buf2), LNG->SpellChecker, _buf);
|
||||||
ShellToDos(_buf, _buf2, LGREY_|_BLACK, YES);
|
ShellToDos(_buf, _buf2, LGREY_|_BLACK, YES);
|
||||||
LoadFile();
|
LoadFile();
|
||||||
|
|
||||||
|
@ -125,14 +125,14 @@ void gfileselect::do_delayed() {
|
|||||||
char buf[200];
|
char buf[200];
|
||||||
char tmp[80];
|
char tmp[80];
|
||||||
|
|
||||||
sprintf(buf, "%s %10s", LNG->SelectedFiles, longdotstr(tmp, selfiles));
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s %10s", LNG->SelectedFiles, longdotstr(tmp, selfiles));
|
||||||
wprints(ylen-4, MAXCOL-34, wattr, buf);
|
wprints(ylen-4, MAXCOL-34, wattr, buf);
|
||||||
sprintf(buf, "%s %10s", LNG->SelectedBytes, longdotstr(tmp, selbytes));
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s %10s", LNG->SelectedBytes, longdotstr(tmp, selbytes));
|
||||||
wprints(ylen-3, MAXCOL-34, wattr, buf);
|
wprints(ylen-3, MAXCOL-34, wattr, buf);
|
||||||
|
|
||||||
sprintf(buf, "%s %10s", LNG->TotalFiles, longdotstr(tmp, totfiles));
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s %10s", LNG->TotalFiles, longdotstr(tmp, totfiles));
|
||||||
wprints(ylen-2, MAXCOL-34, wattr, buf);
|
wprints(ylen-2, MAXCOL-34, wattr, buf);
|
||||||
sprintf(buf, "%s %10s", LNG->TotalBytes, longdotstr(tmp, totbytes));
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s %10s", LNG->TotalBytes, longdotstr(tmp, totbytes));
|
||||||
wprints(ylen-1, MAXCOL-34, wattr, buf);
|
wprints(ylen-1, MAXCOL-34, wattr, buf);
|
||||||
|
|
||||||
if(CFG->switches.get(filelistpagebar))
|
if(CFG->switches.get(filelistpagebar))
|
||||||
@ -149,20 +149,24 @@ const char *gfileselect::gensize(uint32_t size) {
|
|||||||
|
|
||||||
static char ret[16];
|
static char ret[16];
|
||||||
|
|
||||||
if(size >= 1048576000) {
|
if (size >= 1048576000)
|
||||||
|
{
|
||||||
size += 5242880;
|
size += 5242880;
|
||||||
sprintf(ret, "%3d.%02dG", (int) size/1073741824, KFIX((size%1073741824)/1024));
|
gsprintf(PRINTF_DECLARE_BUFFER(ret), "%3d.%02dG", (int) size/1073741824, KFIX((size%1073741824)/1024));
|
||||||
}
|
}
|
||||||
else if(size >= 1024000) {
|
else if (size >= 1024000)
|
||||||
|
{
|
||||||
size += 5120;
|
size += 5120;
|
||||||
sprintf(ret, "%3d.%02dM", (int) size/1048576, KFIX((size%1048576)/1024));
|
gsprintf(PRINTF_DECLARE_BUFFER(ret), "%3d.%02dM", (int) size/1048576, KFIX((size%1048576)/1024));
|
||||||
}
|
}
|
||||||
else if(size >= 1000) {
|
else if (size >= 1000)
|
||||||
|
{
|
||||||
size += 5;
|
size += 5;
|
||||||
sprintf(ret, "%3d.%02dk", (int) size/1024, KFIX(size%1024));
|
gsprintf(PRINTF_DECLARE_BUFFER(ret), "%3d.%02dk", (int) size/1024, KFIX(size%1024));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprintf(ret, "%d", (int) size);
|
gsprintf(PRINTF_DECLARE_BUFFER(ret), "%d", (int) size);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +179,7 @@ void gfileselect::print_line(uint idx, uint pos, bool isbar) {
|
|||||||
|
|
||||||
FFblk& fb = fblk[idx];
|
FFblk& fb = fblk[idx];
|
||||||
|
|
||||||
sprintf(buf, "%c%-*.*s %8s %2d-%02d-%02d %2d:%02d ",
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%c%-*.*s %8s %2d-%02d-%02d %2d:%02d ",
|
||||||
fb.selected ? MMRK_MARK : ' ',
|
fb.selected ? MMRK_MARK : ' ',
|
||||||
MAXCOL-62, (int)MAXCOL-62,
|
MAXCOL-62, (int)MAXCOL-62,
|
||||||
fb.name,
|
fb.name,
|
||||||
@ -402,7 +406,7 @@ void FileSelect(GMsg* msg, char* title, FileSpec* fspec) {
|
|||||||
wvline(0, MAXCOL-36, MAX_POS+1, W_BMENU, C_MENUB);
|
wvline(0, MAXCOL-36, MAX_POS+1, W_BMENU, C_MENUB);
|
||||||
whline(MAX_POS-4, MAXCOL-36, 36, W_BMENU, C_MENUB);
|
whline(MAX_POS-4, MAXCOL-36, 36, W_BMENU, C_MENUB);
|
||||||
|
|
||||||
sprintf(buf, " %s ", strtrim(fbuf));
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), " %s ", strtrim(fbuf));
|
||||||
wmessage(buf, TP_BORD, 1, C_MENUT);
|
wmessage(buf, TP_BORD, 1, C_MENUT);
|
||||||
wmessage(title, TP_BORD, MAXCOL-34, C_MENUT);
|
wmessage(title, TP_BORD, MAXCOL-34, C_MENUT);
|
||||||
|
|
||||||
@ -585,7 +589,8 @@ void CreateFileMsgs(int mode, GMsg* msg) {
|
|||||||
msg->dest.zone, msg->dest.net, msg->dest.node, msg->dest.point
|
msg->dest.zone, msg->dest.net, msg->dest.node, msg->dest.point
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
sprintf(subj, "%s%s%s%s%s ", fspec[x].delsent ? "^" : "", fspec[x].path, fspec[x].fblk ? (fspec[x].fblk[m].name ? fspec[x].fblk[m].name : "") : "", *fspec[x].password ? " " : "", fspec[x].password);
|
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(subj), "%s%s%s%s%s ", fspec[x].delsent ? "^" : "", fspec[x].path, fspec[x].fblk ? (fspec[x].fblk[m].name ? fspec[x].fblk[m].name : "") : "", *fspec[x].password ? " " : "", fspec[x].password);
|
||||||
#if !defined(__UNIX__) && !defined(__WIN32__)
|
#if !defined(__UNIX__) && !defined(__WIN32__)
|
||||||
strupr(subj);
|
strupr(subj);
|
||||||
#endif
|
#endif
|
||||||
@ -887,11 +892,11 @@ void FileRequest(GMsg* msg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do we have a complete announcement?
|
// Do we have a complete announcement?
|
||||||
if(*file and *desc) {
|
if (*file and *desc)
|
||||||
|
{
|
||||||
// Yes, so add it to the list
|
// Yes, so add it to the list
|
||||||
freqfile = (char**)throw_realloc(freqfile, (freqfiles+3)*sizeof(char*));
|
freqfile = (char**)throw_realloc(freqfile, (freqfiles+3)*sizeof(char*));
|
||||||
sprintf(buf, " %-12s %8s %s", file, filesize, desc);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), " %-12s %8s %s", file, filesize, desc);
|
||||||
strsetsz(buf, 76);
|
strsetsz(buf, 76);
|
||||||
freqfile[freqfiles] = throw_strdup(buf);
|
freqfile[freqfiles] = throw_strdup(buf);
|
||||||
*desc = *file = *filesize = NUL;
|
*desc = *file = *filesize = NUL;
|
||||||
@ -910,11 +915,12 @@ void FileRequest(GMsg* msg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add the filelist
|
// Add the filelist
|
||||||
if(not (CFG->frqoptions & FREQ_NOFILES)) {
|
if (not (CFG->frqoptions & FREQ_NOFILES))
|
||||||
|
{
|
||||||
strcpy(file, "FILES");
|
strcpy(file, "FILES");
|
||||||
sprintf(desc, LNG->FilelistFrom, msg->By());
|
gsprintf(PRINTF_DECLARE_BUFFER(desc), LNG->FilelistFrom, msg->By());
|
||||||
freqfile = (char**)throw_realloc(freqfile, (freqfiles+3)*sizeof(char*));
|
freqfile = (char**)throw_realloc(freqfile, (freqfiles+3)*sizeof(char*));
|
||||||
sprintf(buf, " %-12.12s %-52.52s ", file, desc);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), " %-12.12s %-52.52s ", file, desc);
|
||||||
freqfile[freqfiles] = throw_strdup(buf);
|
freqfile[freqfiles] = throw_strdup(buf);
|
||||||
*desc = *file = NUL;
|
*desc = *file = NUL;
|
||||||
freqfiles++;
|
freqfiles++;
|
||||||
@ -972,8 +978,9 @@ void FileRequest(GMsg* msg) {
|
|||||||
if((strlen(msg->re) + strlen(tmpbuf)) < sizeof(ISub)) { // We can only fill one subject line in this version...
|
if((strlen(msg->re) + strlen(tmpbuf)) < sizeof(ISub)) { // We can only fill one subject line in this version...
|
||||||
strcat(msg->re, tmpbuf);
|
strcat(msg->re, tmpbuf);
|
||||||
strcat(msg->re, " ");
|
strcat(msg->re, " ");
|
||||||
if(fh != -1) {
|
if (fh != -1)
|
||||||
sprintf(buf, "%-12s %s\n", tmpbuf, ptr2);
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%-12s %s\n", tmpbuf, ptr2);
|
||||||
write(fh, buf, strlen(buf));
|
write(fh, buf, strlen(buf));
|
||||||
}
|
}
|
||||||
freqs++;
|
freqs++;
|
||||||
@ -995,8 +1002,9 @@ void FileRequest(GMsg* msg) {
|
|||||||
if((strlen(msg->re) + strlen(tmpbuf)) < sizeof(ISub)) { // We can only fill one subject line in this version...
|
if((strlen(msg->re) + strlen(tmpbuf)) < sizeof(ISub)) { // We can only fill one subject line in this version...
|
||||||
strcat(msg->re, tmpbuf);
|
strcat(msg->re, tmpbuf);
|
||||||
strcat(msg->re, " ");
|
strcat(msg->re, " ");
|
||||||
if(fh != -1) {
|
if (fh != -1)
|
||||||
sprintf(buf, "%-12s %s\n", tmpbuf, ptr2);
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%-12s %s\n", tmpbuf, ptr2);
|
||||||
write(fh, buf, strlen(buf));
|
write(fh, buf, strlen(buf));
|
||||||
}
|
}
|
||||||
freqs++;
|
freqs++;
|
||||||
|
@ -476,19 +476,21 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view, bool doedithdr) {
|
|||||||
strcpy(msg->to, "UUCP");
|
strcpy(msg->to, "UUCP");
|
||||||
else
|
else
|
||||||
strcpy(msg->to, msg->idest);
|
strcpy(msg->to, msg->idest);
|
||||||
if(*msg->realby and *msg->iorig) {
|
if (*msg->realby and *msg->iorig)
|
||||||
|
{
|
||||||
char quot[2] = "\"";
|
char quot[2] = "\"";
|
||||||
if((msg->realby[0] == '\"') or (strpbrk(msg->realby, " \t") == NULL))
|
if ((msg->realby[0] == '\"') or (strpbrk(msg->realby, " \t") == NULL))
|
||||||
quot[0] = NUL;
|
quot[0] = NUL;
|
||||||
sprintf(msg->ifrom, "%s%s%s <%s>", quot, msg->realby, quot, msg->iorig);
|
gsprintf(PRINTF_DECLARE_BUFFER(msg->ifrom), "%s%s%s <%s>", quot, msg->realby, quot, msg->iorig);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
strcpy(msg->ifrom, msg->iorig);
|
strcpy(msg->ifrom, msg->iorig);
|
||||||
if(*msg->realto) {
|
if (*msg->realto)
|
||||||
|
{
|
||||||
char quot[2] = "\"";
|
char quot[2] = "\"";
|
||||||
if((msg->realto[0] == '\"') or (strpbrk(msg->realto, " \t") == NULL))
|
if ((msg->realto[0] == '\"') or (strpbrk(msg->realto, " \t") == NULL))
|
||||||
quot[0] = NUL;
|
quot[0] = NUL;
|
||||||
sprintf(msg->ito, "%s%s%s <%s>", quot, msg->realto, quot, msg->idest);
|
gsprintf(PRINTF_DECLARE_BUFFER(msg->ito), "%s%s%s <%s>", quot, msg->realto, quot, msg->idest);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
strcpy(msg->ito, msg->idest);
|
strcpy(msg->ito, msg->idest);
|
||||||
@ -531,14 +533,15 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view, bool doedithdr) {
|
|||||||
Name name;
|
Name name;
|
||||||
strcpy(name, msg->To());
|
strcpy(name, msg->To());
|
||||||
StripQuotes(name);
|
StripQuotes(name);
|
||||||
if(CFG->internetgateexp == ((RFCName << 2) | RFCAddress)) {
|
if (CFG->internetgateexp == ((RFCName << 2) | RFCAddress))
|
||||||
|
{
|
||||||
char quot[2] = "\"";
|
char quot[2] = "\"";
|
||||||
if((name[0] == '\"') or (strpbrk(name, " \t") == NULL))
|
if ((name[0] == '\"') or (strpbrk(name, " \t") == NULL))
|
||||||
quot[0] = NUL;
|
quot[0] = NUL;
|
||||||
sprintf(msg->ito, "%s%s%s <%s>", quot, name, quot, msg->iaddr);
|
gsprintf(PRINTF_DECLARE_BUFFER(msg->ito), "%s%s%s <%s>", quot, name, quot, msg->iaddr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprintf(msg->ito, "%s (%s)", msg->iaddr, name);
|
gsprintf(PRINTF_DECLARE_BUFFER(msg->ito), "%s (%s)", msg->iaddr, name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
strcpy(msg->ito, msg->iaddr);
|
strcpy(msg->ito, msg->iaddr);
|
||||||
|
@ -405,7 +405,7 @@ static void w_brag() {
|
|||||||
whline(6, 0, MAXCOL-5, W_BBRAG, C_BRAGB);
|
whline(6, 0, MAXCOL-5, W_BBRAG, C_BRAGB);
|
||||||
wvline(0, 47, 7, W_BBRAG, C_BRAGB);
|
wvline(0, 47, 7, W_BBRAG, C_BRAGB);
|
||||||
|
|
||||||
sprintf(buf, "---*-*-*** %s ***-*-*---", __gver_releasename__);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "---*-*-*** %s ***-*-*---", __gver_releasename__);
|
||||||
wcenters(8, C_BRAGW, buf);
|
wcenters(8, C_BRAGW, buf);
|
||||||
|
|
||||||
wcenters(10, C_BRAGW, "This program is free software; it is licensed under the");
|
wcenters(10, C_BRAGW, "This program is free software; it is licensed under the");
|
||||||
@ -415,14 +415,18 @@ static void w_brag() {
|
|||||||
|
|
||||||
wcenters(MAXROW-10, C_BRAGW, "This executable is distributed by");
|
wcenters(MAXROW-10, C_BRAGW, "This executable is distributed by");
|
||||||
if (*__gver_vendor_fido__)
|
if (*__gver_vendor_fido__)
|
||||||
sprintf(buf, "%s (Fido: %s) - <%s>", __gver_vendor_name__,
|
{
|
||||||
__gver_vendor_fido__,
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s (Fido: %s) - <%s>",
|
||||||
__gver_vendor_email__);
|
__gver_vendor_name__, __gver_vendor_fido__, __gver_vendor_email__);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
sprintf(buf, "%s <%s>", __gver_vendor_name__,
|
{
|
||||||
__gver_vendor_email__);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s <%s>",
|
||||||
|
__gver_vendor_name__, __gver_vendor_email__);
|
||||||
|
}
|
||||||
|
|
||||||
wcenters(MAXROW-9, C_BRAGW, buf);
|
wcenters(MAXROW-9, C_BRAGW, buf);
|
||||||
sprintf(buf, "Compiled on %s %s", __gver_date__, __gver_time__);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "Compiled on %s %s", __gver_date__, __gver_time__);
|
||||||
wcenters(MAXROW-8, C_BRAGW, buf);
|
wcenters(MAXROW-8, C_BRAGW, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -729,7 +733,7 @@ void Initialize(int argc, char* argv[]) {
|
|||||||
|
|
||||||
// Start the log
|
// Start the log
|
||||||
static char buf[200];
|
static char buf[200];
|
||||||
sprintf(buf, "%s %s (%s %s)", __gver_longpid__, __gver_ver__, __gver_date__, __gver_time__);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s %s (%s %s)", __gver_longpid__, __gver_ver__, __gver_date__, __gver_time__);
|
||||||
LOG.open(CFG->logfile, buf, __gver_shortlogname__, CFG->logformat);
|
LOG.open(CFG->logfile, buf, __gver_shortlogname__, CFG->logformat);
|
||||||
|
|
||||||
// Read/compile various configs
|
// Read/compile various configs
|
||||||
|
@ -637,12 +637,13 @@ static void KludgeBCC(GMsg* msg, const char* ptr) {
|
|||||||
IAdr buf2;
|
IAdr buf2;
|
||||||
mime_header_encode(buf2, _toname, msg);
|
mime_header_encode(buf2, _toname, msg);
|
||||||
char quot[2] = "\"";
|
char quot[2] = "\"";
|
||||||
if((buf2[0] == '\"') or (strpbrk(buf2, " \t") == NULL))
|
if ((buf2[0] == '\"') or (strpbrk(buf2, " \t") == NULL))
|
||||||
quot[0] = NUL;
|
quot[0] = NUL;
|
||||||
sprintf(buf, "%s%s%s <%s>", quot, buf2, quot, _toaddr);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s%s%s <%s>", quot, buf2, quot, _toaddr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprintf(buf, "%s", _toaddr);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s", _toaddr);
|
||||||
|
|
||||||
strxcat(msg->ibcc, buf, sizeof(msg->ibcc));
|
strxcat(msg->ibcc, buf, sizeof(msg->ibcc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -668,12 +669,13 @@ static void KludgeCC(GMsg* msg, const char* ptr) {
|
|||||||
IAdr buf2;
|
IAdr buf2;
|
||||||
mime_header_encode(buf2, _toname, msg);
|
mime_header_encode(buf2, _toname, msg);
|
||||||
char quot[2] = "\"";
|
char quot[2] = "\"";
|
||||||
if((buf[0] == '\"') or (strpbrk(buf2, " \t") == NULL))
|
if ((buf[0] == '\"') or (strpbrk(buf2, " \t") == NULL))
|
||||||
quot[0] = NUL;
|
quot[0] = NUL;
|
||||||
sprintf(buf, "%s%s%s <%s>", quot, buf2, quot, _toaddr);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s%s%s <%s>", quot, buf2, quot, _toaddr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprintf(buf, "%s", _toaddr);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s", _toaddr);
|
||||||
|
|
||||||
strxcat(msg->icc, buf, sizeof(msg->icc));
|
strxcat(msg->icc, buf, sizeof(msg->icc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2069,8 +2071,9 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) {
|
|||||||
uint _size = strlen(msg->txt);
|
uint _size = strlen(msg->txt);
|
||||||
if(streql(AA->basetype(), "OPUS") or streql(AA->basetype(), "FTS1"))
|
if(streql(AA->basetype(), "OPUS") or streql(AA->basetype(), "FTS1"))
|
||||||
idxadjust = 190;
|
idxadjust = 190;
|
||||||
for(idx=0; idx < _size; ptr+=16,idx+=16) {
|
for (idx=0; idx < _size; ptr+=16,idx+=16)
|
||||||
sprintf(buf, "%04X ", idx+idxadjust);
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%04X ", idx+idxadjust);
|
||||||
HexDump16(buf+7, ptr, MinV((int)(_size-idx), 16), HEX_DUMP2);
|
HexDump16(buf+7, ptr, MinV((int)(_size-idx), 16), HEX_DUMP2);
|
||||||
line = AddLine(line, buf);
|
line = AddLine(line, buf);
|
||||||
}
|
}
|
||||||
@ -3203,10 +3206,10 @@ Line* AddHexdump(Line*& line, void* data, size_t datalen) {
|
|||||||
uint pos = 0;
|
uint pos = 0;
|
||||||
char* ptr = (char*)data;
|
char* ptr = (char*)data;
|
||||||
|
|
||||||
while(pos < datalen) {
|
while (pos < datalen)
|
||||||
|
{
|
||||||
uint dataleft = datalen - pos;
|
uint dataleft = datalen - pos;
|
||||||
sprintf(buf, "%04X ", pos);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%04X ", pos);
|
||||||
HexDump16(buf+7, ptr, (dataleft < 16) ? dataleft : 16, HEX_DUMP2);
|
HexDump16(buf+7, ptr, (dataleft < 16) ? dataleft : 16, HEX_DUMP2);
|
||||||
line = AddLine(line, buf);
|
line = AddLine(line, buf);
|
||||||
ptr += 16;
|
ptr += 16;
|
||||||
|
@ -772,9 +772,10 @@ int ChangeUsername() {
|
|||||||
if(not CFG->username.empty()) {
|
if(not CFG->username.empty()) {
|
||||||
Listi = (char**)throw_calloc(CFG->username.size()+1, sizeof(char*));
|
Listi = (char**)throw_calloc(CFG->username.size()+1, sizeof(char*));
|
||||||
std::vector<Node>::iterator i;
|
std::vector<Node>::iterator i;
|
||||||
for(n = 0, i = CFG->username.begin(); i != CFG->username.end(); n++, i++) {
|
for (n = 0, i = CFG->username.begin(); i != CFG->username.end(); n++, i++)
|
||||||
|
{
|
||||||
i->addr.make_string(adrs);
|
i->addr.make_string(adrs);
|
||||||
sprintf(buf, " %-35s %s ", i->name, adrs);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), " %-35s %s ", i->name, adrs);
|
||||||
Listi[n] = throw_strdup(buf);
|
Listi[n] = throw_strdup(buf);
|
||||||
}
|
}
|
||||||
n = MinV(n, (MAXROW-10));
|
n = MinV(n, (MAXROW-10));
|
||||||
@ -818,9 +819,10 @@ int ChangeTemplate() {
|
|||||||
if(not CFG->tpl.empty()) {
|
if(not CFG->tpl.empty()) {
|
||||||
Listi = (char**)throw_calloc(CFG->tpl.size()+1, sizeof(char*));
|
Listi = (char**)throw_calloc(CFG->tpl.size()+1, sizeof(char*));
|
||||||
std::vector<Tpl>::iterator t;
|
std::vector<Tpl>::iterator t;
|
||||||
for(n = 0, t = CFG->tpl.begin(); t != CFG->tpl.end(); n++, t++) {
|
for (n = 0, t = CFG->tpl.begin(); t != CFG->tpl.end(); n++, t++)
|
||||||
|
{
|
||||||
t->match.make_string(adrs);
|
t->match.make_string(adrs);
|
||||||
sprintf(buf, " %-45s %s ", t->name, adrs);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), " %-45s %s ", t->name, adrs);
|
||||||
Listi[n] = throw_strdup(buf);
|
Listi[n] = throw_strdup(buf);
|
||||||
}
|
}
|
||||||
n = MinV(n, (MAXROW-10));
|
n = MinV(n, (MAXROW-10));
|
||||||
@ -858,9 +860,10 @@ int ChangeAka() {
|
|||||||
|
|
||||||
if(CFG->aka.size() > 1) {
|
if(CFG->aka.size() > 1) {
|
||||||
Listi = (char**)throw_calloc(CFG->aka.size()+1, sizeof(char*));
|
Listi = (char**)throw_calloc(CFG->aka.size()+1, sizeof(char*));
|
||||||
for(i = CFG->aka.begin(), n=0; i != CFG->aka.end(); n++, i++) {
|
for (i = CFG->aka.begin(), n=0; i != CFG->aka.end(); n++, i++)
|
||||||
|
{
|
||||||
i->addr.make_string(addr, i->domain);
|
i->addr.make_string(addr, i->domain);
|
||||||
sprintf(buf, " %s ", addr);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), " %s ", addr);
|
||||||
Listi[n] = throw_strdup(buf);
|
Listi[n] = throw_strdup(buf);
|
||||||
if(AA->Aka().addr.equals(i->addr))
|
if(AA->Aka().addr.equals(i->addr))
|
||||||
startat = n;
|
startat = n;
|
||||||
@ -911,12 +914,12 @@ int ChangeXlatImport() {
|
|||||||
}
|
}
|
||||||
Listi[0] = throw_strdup(LNG->CharsetAuto);
|
Listi[0] = throw_strdup(LNG->CharsetAuto);
|
||||||
xlatimports = 1;
|
xlatimports = 1;
|
||||||
for(xlt = CFG->xlatcharset.begin(); xlt != CFG->xlatcharset.end(); xlt++) {
|
for (xlt = CFG->xlatcharset.begin(); xlt != CFG->xlatcharset.end(); xlt++)
|
||||||
if(strieql(xlt->exp, CFG->xlatlocalset)) {
|
{
|
||||||
sprintf(buf, " %*.*s -> %-*.*s ",
|
if (strieql(xlt->exp, CFG->xlatlocalset))
|
||||||
maximport, maximport, xlt->imp,
|
{
|
||||||
maxexport, maxexport, xlt->exp
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), " %*.*s -> %-*.*s ",
|
||||||
);
|
maximport, maximport, xlt->imp, maxexport, maxexport, xlt->exp);
|
||||||
Listi[xlatimports++] = throw_strdup(buf);
|
Listi[xlatimports++] = throw_strdup(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -948,4 +951,3 @@ int ChangeXlatImport() {
|
|||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -359,8 +359,9 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) {
|
|||||||
strsetsz(dbuf, 10);
|
strsetsz(dbuf, 10);
|
||||||
else
|
else
|
||||||
*dbuf = NUL;
|
*dbuf = NUL;
|
||||||
sprintf(nbuf, "%5u", (CFG->switches.get(disprealmsgno) ? ml->msgno : AA->Msgn.ToReln(ml->msgno)));
|
|
||||||
sprintf(buf, "%-5.5s%s%-*.*s %-*.*s%s%-*.*s %s",
|
gsprintf(PRINTF_DECLARE_BUFFER(nbuf), "%5u", (CFG->switches.get(disprealmsgno) ? ml->msgno : AA->Msgn.ToReln(ml->msgno)));
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%-5.5s%s%-*.*s %-*.*s%s%-*.*s %s",
|
||||||
nbuf, ml->marks,
|
nbuf, ml->marks,
|
||||||
bysiz, bysiz, ml->by,
|
bysiz, bysiz, ml->by,
|
||||||
tosiz, tosiz, ml->to,
|
tosiz, tosiz, ml->to,
|
||||||
@ -939,7 +940,7 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) {
|
|||||||
marks[1] = MMRK_MARK;
|
marks[1] = MMRK_MARK;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buf, "%6u %*c", (CFG->switches.get(disprealmsgno) ? t.msgno : AA->Msgn.ToReln(t.msgno)), tdlen, ' ');
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%6u %*c", (CFG->switches.get(disprealmsgno) ? t.msgno : AA->Msgn.ToReln(t.msgno)), tdlen, ' ');
|
||||||
|
|
||||||
if(AA->Msglistdate() != MSGLISTDATE_NONE) {
|
if(AA->Msglistdate() != MSGLISTDATE_NONE) {
|
||||||
char dbuf[11];
|
char dbuf[11];
|
||||||
|
@ -483,7 +483,7 @@ int GMenuEditfile::Run(GMsg* __msg) {
|
|||||||
update_statuslinef(LNG->Quotepct, "ST_QUOTEPCT", __msg->quotepct, __msg->quotepct > 80 ? "!!!" : "");
|
update_statuslinef(LNG->Quotepct, "ST_QUOTEPCT", __msg->quotepct, __msg->quotepct > 80 ? "!!!" : "");
|
||||||
|
|
||||||
char _title[80];
|
char _title[80];
|
||||||
sprintf(_title, LNG->SaveMsg, __msg->lines);
|
gsprintf(PRINTF_DECLARE_BUFFER(_title), LNG->SaveMsg, __msg->lines);
|
||||||
AskInit(6, 0, _title, H_SaveMsg);
|
AskInit(6, 0, _title, H_SaveMsg);
|
||||||
|
|
||||||
Begin();
|
Begin();
|
||||||
@ -538,9 +538,11 @@ int GMenuEditfile::Run(GMsg* __msg) {
|
|||||||
GetRandomLine(_buf, sizeof(_buf), _buf+1);
|
GetRandomLine(_buf, sizeof(_buf), _buf+1);
|
||||||
strcpy(__msg->tagline, _buf);
|
strcpy(__msg->tagline, _buf);
|
||||||
Line* _line = __msg->lin;
|
Line* _line = __msg->lin;
|
||||||
while(_line) {
|
while (_line)
|
||||||
if(_line->type & GLINE_TAGL) {
|
{
|
||||||
sprintf(_buf, "%c%c%c %s ", AA->Taglinechar(), AA->Taglinechar(), AA->Taglinechar(), __msg->tagline);
|
if (_line->type & GLINE_TAGL)
|
||||||
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(_buf), "%c%c%c %s ", AA->Taglinechar(), AA->Taglinechar(), AA->Taglinechar(), __msg->tagline);
|
||||||
strtrim(_buf);
|
strtrim(_buf);
|
||||||
_line->txt = _buf;
|
_line->txt = _buf;
|
||||||
break;
|
break;
|
||||||
@ -560,9 +562,11 @@ int GMenuEditfile::Run(GMsg* __msg) {
|
|||||||
GetRandomLine(_buf, sizeof(_buf), _buf+1);
|
GetRandomLine(_buf, sizeof(_buf), _buf+1);
|
||||||
MakeOrigin(__msg, _buf);
|
MakeOrigin(__msg, _buf);
|
||||||
Line* _line = __msg->lin;
|
Line* _line = __msg->lin;
|
||||||
while(_line) {
|
while (_line)
|
||||||
if(_line->type & GLINE_ORIG) {
|
{
|
||||||
sprintf(_buf, " * Origin: %s ", __msg->origin);
|
if (_line->type & GLINE_ORIG)
|
||||||
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(_buf), " * Origin: %s ", __msg->origin);
|
||||||
strtrim(_buf);
|
strtrim(_buf);
|
||||||
_line->txt = _buf;
|
_line->txt = _buf;
|
||||||
break;
|
break;
|
||||||
@ -1230,4 +1234,3 @@ int GMenuSChecker::Run(CSpellChecker &schecker, const char *word)
|
|||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ void MarkMsgs(GMsg* msg) {
|
|||||||
|
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
case TAG_MARKYOURMAIL:
|
case TAG_MARKYOURMAIL:
|
||||||
sprintf(markstring, "\"%s\"", AA->Username().name);
|
gsprintf(PRINTF_DECLARE_BUFFER(markstring), "\"%s\"", AA->Username().name);
|
||||||
// Drop through!
|
// Drop through!
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
|
@ -145,7 +145,7 @@ void TokenXlat(int mode, std::string &input, GMsg* msg, GMsg* oldmsg, int __orig
|
|||||||
{
|
{
|
||||||
static char revbuf[5] = "";
|
static char revbuf[5] = "";
|
||||||
if (revbuf[0] == NUL)
|
if (revbuf[0] == NUL)
|
||||||
sprintf(revbuf, "%02d%02d", str2mon(__gver_date__), atoi(&__gver_date__[4]));
|
gsprintf(PRINTF_DECLARE_BUFFER(revbuf), "%02d%02d", str2mon(__gver_date__), atoi(&__gver_date__[4]));
|
||||||
|
|
||||||
char attr[80];
|
char attr[80];
|
||||||
MakeAttrStr(attr, sizeof(attr), &msg->attr);
|
MakeAttrStr(attr, sizeof(attr), &msg->attr);
|
||||||
@ -175,10 +175,10 @@ void TokenXlat(int mode, std::string &input, GMsg* msg, GMsg* oldmsg, int __orig
|
|||||||
char* modereptr = oldmsg->re;
|
char* modereptr = oldmsg->re;
|
||||||
|
|
||||||
char msgno[16];
|
char msgno[16];
|
||||||
sprintf(msgno, "%u", msg->attr.nwm() ? AA->Msgn.Count() + 1 : AA->Msgn.ToReln(msg->msgno));
|
gsprintf(PRINTF_DECLARE_BUFFER(msgno), "%u", msg->attr.nwm() ? AA->Msgn.Count() + 1 : AA->Msgn.ToReln(msg->msgno));
|
||||||
|
|
||||||
char msgs[16];
|
char msgs[16];
|
||||||
sprintf(msgs, "%u", AA->Msgn.Count() + (msg->attr.nwm() ? 1 : 0));
|
gsprintf(PRINTF_DECLARE_BUFFER(msgs), "%u", AA->Msgn.Count() + (msg->attr.nwm() ? 1 : 0));
|
||||||
|
|
||||||
if ((mode == MODE_QUOTE) or (mode == MODE_REPLYCOMMENT) or (mode == MODE_REPLY))
|
if ((mode == MODE_QUOTE) or (mode == MODE_REPLYCOMMENT) or (mode == MODE_REPLY))
|
||||||
{
|
{
|
||||||
@ -231,7 +231,7 @@ void TokenXlat(int mode, std::string &input, GMsg* msg, GMsg* oldmsg, int __orig
|
|||||||
if (tokenxchg(input, dst, "@odtime", odtime))
|
if (tokenxchg(input, dst, "@odtime", odtime))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (tokenxchg(input, dst, "@otzoffset", (oldmsg->tzutc == -32767) ? "" : (sprintf(buf, " %+05d", oldmsg->tzutc), buf)))
|
if (tokenxchg(input, dst, "@otzoffset", (oldmsg->tzutc == -32767) ? "" : (gsprintf(PRINTF_DECLARE_BUFFER(buf), " %+05d", oldmsg->tzutc), buf)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (tokenxchg(input, dst, "@ofrom", oldmsg->ifrom))
|
if (tokenxchg(input, dst, "@ofrom", oldmsg->ifrom))
|
||||||
@ -384,7 +384,7 @@ void TokenXlat(int mode, std::string &input, GMsg* msg, GMsg* oldmsg, int __orig
|
|||||||
if (tokenxchg(input, dst, "@cdtime", cdtime))
|
if (tokenxchg(input, dst, "@cdtime", cdtime))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (tokenxchg(input, dst, "@ctzoffset", AA->Usetzutc() ? (sprintf(buf, " %+05d", tzoffset()), buf) : ""))
|
if (tokenxchg(input, dst, "@ctzoffset", AA->Usetzutc() ? (gsprintf(PRINTF_DECLARE_BUFFER(buf), " %+05d", tzoffset()), buf) : ""))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (tokenxchg(input, dst, "@fname", strbtrim(strtmp(msg->By())), 34))
|
if (tokenxchg(input, dst, "@fname", strbtrim(strtmp(msg->By())), 34))
|
||||||
|
@ -176,22 +176,22 @@ void NodelistBrowser::AfterCursor() {
|
|||||||
|
|
||||||
ftn_nodelist_entry* entryp = entries + (pos - 1);
|
ftn_nodelist_entry* entryp = entries + (pos - 1);
|
||||||
|
|
||||||
sprintf(line1, " %s%s%s%s%s%s ",
|
gsprintf(PRINTF_DECLARE_BUFFER(line1), " %s%s%s%s%s%s ",
|
||||||
entryp->name,
|
entryp->name,
|
||||||
(*entryp->system ? ", " : ""), entryp->system,
|
(*entryp->system ? ", " : ""), entryp->system,
|
||||||
(*entryp->status ? " <" : ""), entryp->status,
|
(*entryp->status ? " <" : ""), entryp->status,
|
||||||
(*entryp->status ? ">" : "")
|
(*entryp->status ? ">" : "")
|
||||||
);
|
);
|
||||||
sprintf(buf, "%s %s", LNG->Phone, *entryp->phone ? entryp->phone : "-Unpublished-");
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s %s", LNG->Phone, *entryp->phone ? entryp->phone : "-Unpublished-");
|
||||||
strrjust(strsetsz(buf, MAXCOL-strlen(line1)-1));
|
strrjust(strsetsz(buf, MAXCOL-strlen(line1)-1));
|
||||||
strcat(line1, buf);
|
strcat(line1, buf);
|
||||||
strcat(line1, " ");
|
strcat(line1, " ");
|
||||||
|
|
||||||
sprintf(line2, " %s%s%s",
|
gsprintf(PRINTF_DECLARE_BUFFER(line2), " %s%s%s",
|
||||||
entryp->location,
|
entryp->location,
|
||||||
(*entryp->location ? ", " : ""), entryp->address
|
(*entryp->location ? ", " : ""), entryp->address
|
||||||
);
|
);
|
||||||
sprintf(buf, "%s%s%s%s",
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%s%s%s%s",
|
||||||
entryp->baud,
|
entryp->baud,
|
||||||
(*entryp->baud ? " Bps" : ""),
|
(*entryp->baud ? " Bps" : ""),
|
||||||
((*entryp->baud and *entryp->flags) ? ", " : ""), entryp->flags
|
((*entryp->baud and *entryp->flags) ? ", " : ""), entryp->flags
|
||||||
@ -204,20 +204,21 @@ void NodelistBrowser::AfterCursor() {
|
|||||||
|
|
||||||
Path nlname;
|
Path nlname;
|
||||||
*nlname = NUL;
|
*nlname = NUL;
|
||||||
if(NLP->index_name() and NLP->nodelist_name())
|
if (NLP->index_name() and NLP->nodelist_name())
|
||||||
sprintf(nlname, " %s / %s ", NLP->index_name(), CleanFilename(NLP->nodelist_name()));
|
gsprintf(PRINTF_DECLARE_BUFFER(nlname), " %s / %s ", NLP->index_name(), CleanFilename(NLP->nodelist_name()));
|
||||||
else if(NLP->index_name())
|
else if (NLP->index_name())
|
||||||
sprintf(nlname, " %s ", NLP->index_name());
|
gsprintf(PRINTF_DECLARE_BUFFER(nlname), " %s ", NLP->index_name());
|
||||||
if(*nlname)
|
|
||||||
|
if (*nlname)
|
||||||
listwin.title(nlname, tattr, TCENTER|TBOTTOM);
|
listwin.title(nlname, tattr, TCENTER|TBOTTOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
void NodelistBrowser::InitDisplay() {
|
void NodelistBrowser::InitDisplay()
|
||||||
|
{
|
||||||
sprintf(titlet, LNG->Lookup, user_maybe);
|
gsprintf(PRINTF_DECLARE_BUFFER(titlet), LNG->Lookup, user_maybe);
|
||||||
listwin.title(titlet, tattr, TCENTER);
|
listwin.title(titlet, tattr, TCENTER);
|
||||||
|
|
||||||
Center();
|
Center();
|
||||||
@ -722,7 +723,7 @@ int NodelistBrowser::DoKey(gkey& keycode) {
|
|||||||
else if(user_fuzidx)
|
else if(user_fuzidx)
|
||||||
user_maybe[--user_fuzidx] = 0;
|
user_maybe[--user_fuzidx] = 0;
|
||||||
user_maybe[user_fuzidx] = 0;
|
user_maybe[user_fuzidx] = 0;
|
||||||
sprintf(titlet, LNG->Lookup, user_maybe);
|
gsprintf(PRINTF_DECLARE_BUFFER(titlet), LNG->Lookup, user_maybe);
|
||||||
listwin.title(titlet, tattr, TCENTER);
|
listwin.title(titlet, tattr, TCENTER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,22 +188,27 @@ void CheckSubject(GMsg* msg, char* subj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generate the (first) processed subject line
|
// Generate the (first) processed subject line
|
||||||
if(specfiles) {
|
if (specfiles)
|
||||||
|
{
|
||||||
ISub buf;
|
ISub buf;
|
||||||
*buf = NUL;
|
*buf = NUL;
|
||||||
for(int x=0,n=0; x<fspecs; x++) {
|
for (int x = 0,n = 0; x < fspecs; x++)
|
||||||
for(int m=0; m<fspec[x].files; m++) {
|
{
|
||||||
|
for (int m = 0; m<fspec[x].files; m++)
|
||||||
|
{
|
||||||
ISub subject;
|
ISub subject;
|
||||||
sprintf(subject, "%s%s%s%s%s ", fspec[x].delsent ? "^" : "", ReMapPath(fspec[x].path), fspec[x].fblk ? (fspec[x].fblk[m].name ? fspec[x].fblk[m].name : "") : "", *fspec[x].password ? " " : "", fspec[x].password);
|
gsprintf(PRINTF_DECLARE_BUFFER(subject), "%s%s%s%s%s ", fspec[x].delsent ? "^" : "", ReMapPath(fspec[x].path), fspec[x].fblk ? (fspec[x].fblk[m].name ? fspec[x].fblk[m].name : "") : "", *fspec[x].password ? " " : "", fspec[x].password);
|
||||||
if((strlen(buf) + strlen(subject)) > 71) {
|
|
||||||
|
if ((strlen(buf) + strlen(subject)) > 71)
|
||||||
|
{
|
||||||
n++;
|
n++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
strcat(buf, subject);
|
strcat(buf, subject);
|
||||||
}
|
}
|
||||||
if(n)
|
|
||||||
break;
|
if (n) break;
|
||||||
}
|
}
|
||||||
strtrim(strcpy(subj, buf));
|
strtrim(strcpy(subj, buf));
|
||||||
}
|
}
|
||||||
@ -233,12 +238,13 @@ static void MakeMsg3(int& mode, GMsg* msg) {
|
|||||||
std::vector<gaka>::iterator u;
|
std::vector<gaka>::iterator u;
|
||||||
|
|
||||||
msg->charsetlevel = 0;
|
msg->charsetlevel = 0;
|
||||||
if(*AA->Xlatexport()) {
|
if (*AA->Xlatexport())
|
||||||
|
{
|
||||||
msg->charsetlevel = LoadCharset(CFG->xlatlocalset, AA->Xlatexport());
|
msg->charsetlevel = LoadCharset(CFG->xlatlocalset, AA->Xlatexport());
|
||||||
if(msg->charsetlevel)
|
if (msg->charsetlevel)
|
||||||
sprintf(msg->charset, "%s %d", AA->Xlatexport(), msg->charsetlevel);
|
gsprintf(PRINTF_DECLARE_BUFFER(msg->charset), "%s %d", AA->Xlatexport(), msg->charsetlevel);
|
||||||
else
|
else
|
||||||
sprintf(msg->charset, "%s 2", CFG->xlatlocalset);
|
gsprintf(PRINTF_DECLARE_BUFFER(msg->charset), "%s 2", CFG->xlatlocalset);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do Timefields
|
// Do Timefields
|
||||||
@ -531,15 +537,16 @@ static void MakeMsg2(int& mode, int& status, int& forwstat, int& topline, GMsg*
|
|||||||
}
|
}
|
||||||
if(mode == MODE_FORWARD)
|
if(mode == MODE_FORWARD)
|
||||||
status = MODE_SAVE;
|
status = MODE_SAVE;
|
||||||
if(*EDIT->External() and forwstat == NO and not EDIT->Internal()) {
|
if (*EDIT->External() and forwstat == NO and not EDIT->Internal())
|
||||||
|
{
|
||||||
strcpy(buf, EDIT->External());
|
strcpy(buf, EDIT->External());
|
||||||
sprintf(buf2, "%u", position);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf2), "%u", position);
|
||||||
strischg(buf, "@line", buf2);
|
strischg(buf, "@line", buf2);
|
||||||
strcpy(buf2, AddPath(CFG->goldpath, EDIT->File()));
|
strcpy(buf2, AddPath(CFG->goldpath, EDIT->File()));
|
||||||
strchg(buf2, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
|
strchg(buf2, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
|
||||||
strischg(buf, "@file", buf2);
|
strischg(buf, "@file", buf2);
|
||||||
long ftbefore = GetFiletime(AddPath(CFG->goldpath, EDIT->File()));
|
long ftbefore = GetFiletime(AddPath(CFG->goldpath, EDIT->File()));
|
||||||
sprintf(buf2, LNG->EditCmd, buf);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf2), LNG->EditCmd, buf);
|
||||||
ShellToDos(buf, buf2, LGREY_|_BLACK, YES);
|
ShellToDos(buf, buf2, LGREY_|_BLACK, YES);
|
||||||
long ftafter = GetFiletime(AddPath(CFG->goldpath, EDIT->File()));
|
long ftafter = GetFiletime(AddPath(CFG->goldpath, EDIT->File()));
|
||||||
if(status != MODE_SAVE) {
|
if(status != MODE_SAVE) {
|
||||||
@ -740,10 +747,10 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
|
|||||||
msg->TextToLines(CFG->dispmargin-1);
|
msg->TextToLines(CFG->dispmargin-1);
|
||||||
msg->orig = AA->Aka().addr;
|
msg->orig = AA->Aka().addr;
|
||||||
msg->charsetlevel = LoadCharset(CFG->xlatlocalset, AA->Xlatexport());
|
msg->charsetlevel = LoadCharset(CFG->xlatlocalset, AA->Xlatexport());
|
||||||
if(msg->charsetlevel)
|
if (msg->charsetlevel)
|
||||||
sprintf(msg->charset, "%s %d", AA->Xlatexport(), msg->charsetlevel);
|
gsprintf(PRINTF_DECLARE_BUFFER(msg->charset), "%s %d", AA->Xlatexport(), msg->charsetlevel);
|
||||||
else
|
else
|
||||||
sprintf(msg->charset, "%s 2", CFG->xlatlocalset);
|
gsprintf(PRINTF_DECLARE_BUFFER(msg->charset), "%s 2", CFG->xlatlocalset);
|
||||||
strcpy(msg->odom, CFG->aka[AkaMatch(&msg->orig, &AA->Aka().addr)].domain);
|
strcpy(msg->odom, CFG->aka[AkaMatch(&msg->orig, &AA->Aka().addr)].domain);
|
||||||
if(AA->isecho() or have_origin(msg))
|
if(AA->isecho() or have_origin(msg))
|
||||||
DoTearorig(mode, msg);
|
DoTearorig(mode, msg);
|
||||||
@ -929,10 +936,12 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
|
|||||||
|
|
||||||
uint32_t number;
|
uint32_t number;
|
||||||
const char* r = get_subject_re_info(msg->re, number);
|
const char* r = get_subject_re_info(msg->re, number);
|
||||||
if(r) {
|
if (r)
|
||||||
if(AA->Replyre() == REPLYRE_NUMERIC and not AA->isinternet()) {
|
{
|
||||||
|
if (AA->Replyre() == REPLYRE_NUMERIC and not AA->isinternet())
|
||||||
|
{
|
||||||
ISub subj;
|
ISub subj;
|
||||||
sprintf(subj, "Re^%u:%s", (((number+1) > number) ? (number+1) : number), r);
|
gsprintf(PRINTF_DECLARE_BUFFER(subj), "Re^%u:%s", (((number+1) > number) ? (number+1) : number), r);
|
||||||
strcpy(msg->re, subj);
|
strcpy(msg->re, subj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ static void ReadGldFile() {
|
|||||||
Path gldfile;
|
Path gldfile;
|
||||||
|
|
||||||
QWK->ResetConfNo();
|
QWK->ResetConfNo();
|
||||||
sprintf(gldfile, "%s%s.GLD", CFG->goldpath, QWK->BbsID());
|
gsprintf(PRINTF_DECLARE_BUFFER(gldfile), "%s%s.GLD", CFG->goldpath, QWK->BbsID());
|
||||||
|
|
||||||
gfile fp(gldfile, "rt");
|
gfile fp(gldfile, "rt");
|
||||||
if (fp.isopen())
|
if (fp.isopen())
|
||||||
@ -97,9 +97,10 @@ int ImportQWK() {
|
|||||||
}
|
}
|
||||||
else if(line == 5) {
|
else if(line == 5) {
|
||||||
char* ptr = strchr(buf, ',');
|
char* ptr = strchr(buf, ',');
|
||||||
if(ptr) {
|
if (ptr)
|
||||||
|
{
|
||||||
strxcpy(bbsid, strskip_wht(ptr+1), 9);
|
strxcpy(bbsid, strskip_wht(ptr+1), 9);
|
||||||
sprintf(gldfile, "%s%s.GLD", CFG->goldpath, bbsid);
|
gsprintf(PRINTF_DECLARE_BUFFER(gldfile), "%s%s.GLD", CFG->goldpath, bbsid);
|
||||||
fpb.Fopen(gldfile, "wt");
|
fpb.Fopen(gldfile, "wt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -243,9 +244,11 @@ int ImportQWK() {
|
|||||||
INam _fromname;
|
INam _fromname;
|
||||||
IAdr _fromaddr;
|
IAdr _fromaddr;
|
||||||
ParseInternetAddr(msg->ifrom, _fromname, _fromaddr);
|
ParseInternetAddr(msg->ifrom, _fromname, _fromaddr);
|
||||||
if(AA->Internetgate().addr.valid()) {
|
if (AA->Internetgate().addr.valid())
|
||||||
|
{
|
||||||
char abuf[40];
|
char abuf[40];
|
||||||
sprintf(kbuf, "\x1""REPLYTO %s %s\r""\x1""REPLYADDR %s\r",
|
gsprintf(PRINTF_DECLARE_BUFFER(kbuf),
|
||||||
|
"\x1""REPLYTO %s %s\r""\x1""REPLYADDR %s\r",
|
||||||
AA->Internetgate().addr.make_string(abuf),
|
AA->Internetgate().addr.make_string(abuf),
|
||||||
*AA->Internetgate().name ? AA->Internetgate().name : "UUCP",
|
*AA->Internetgate().name ? AA->Internetgate().name : "UUCP",
|
||||||
_fromaddr
|
_fromaddr
|
||||||
@ -337,9 +340,10 @@ int ImportQWK() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(imported and *QWK->ReplyLinker()) {
|
if (imported and *QWK->ReplyLinker())
|
||||||
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
sprintf(buf, LNG->Replylinker, QWK->ReplyLinker());
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), LNG->Replylinker, QWK->ReplyLinker());
|
||||||
ShellToDos(QWK->ReplyLinker(), buf, LGREY_|_BLACK, YES);
|
ShellToDos(QWK->ReplyLinker(), buf, LGREY_|_BLACK, YES);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -357,8 +361,8 @@ int ExportQwkMsg(GMsg* msg, gfile& fp, int confno, int& pktmsgno) {
|
|||||||
|
|
||||||
// Prepare for Return Receipt Request
|
// Prepare for Return Receipt Request
|
||||||
char msg__re[26];
|
char msg__re[26];
|
||||||
if(QWK->ReceiptAllowed() and msg->attr.rrq())
|
if (QWK->ReceiptAllowed() and msg->attr.rrq())
|
||||||
sprintf(msg__re, "RRR%-22.22s", msg->re);
|
gsprintf(PRINTF_DECLARE_BUFFER(msg__re), "RRR%-22.22s", msg->re);
|
||||||
else
|
else
|
||||||
strxcpy(msg__re, msg->re, 26);
|
strxcpy(msg__re, msg->re, 26);
|
||||||
|
|
||||||
@ -370,13 +374,13 @@ int ExportQwkMsg(GMsg* msg, gfile& fp, int confno, int& pktmsgno) {
|
|||||||
int relen = strlen(msg__re); relen = MinV(25,relen);
|
int relen = strlen(msg__re); relen = MinV(25,relen);
|
||||||
memset(&hdr, ' ', sizeof(QWKHdr));
|
memset(&hdr, ' ', sizeof(QWKHdr));
|
||||||
hdr.status = msg->attr.pvt() ? '*' : ' ';
|
hdr.status = msg->attr.pvt() ? '*' : ' ';
|
||||||
sprintf(buf, "%u", confno);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%u", confno);
|
||||||
memcpy(hdr.msgno, buf, strlen(buf));
|
memcpy(hdr.msgno, buf, strlen(buf));
|
||||||
struct tm _tm; ggmtime(&_tm, &msg->written);
|
struct tm _tm; ggmtime(&_tm, &msg->written);
|
||||||
int _year = _tm.tm_year % 100;
|
int _year = _tm.tm_year % 100;
|
||||||
sprintf(buf, "%02d-%02d-%02d", _tm.tm_mon+1, _tm.tm_mday, _year);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%02d-%02d-%02d", _tm.tm_mon+1, _tm.tm_mday, _year);
|
||||||
memcpy(hdr.date, buf, 8);
|
memcpy(hdr.date, buf, 8);
|
||||||
sprintf(buf, "%02d:%02d", _tm.tm_hour, _tm.tm_min);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%02d:%02d", _tm.tm_hour, _tm.tm_min);
|
||||||
memcpy(hdr.time, buf, 5);
|
memcpy(hdr.time, buf, 5);
|
||||||
strxcpy(buf, msg->to, tolen+1);
|
strxcpy(buf, msg->to, tolen+1);
|
||||||
if(not QWK->MixCaseAllowed())
|
if(not QWK->MixCaseAllowed())
|
||||||
@ -460,7 +464,7 @@ int ExportQwkMsg(GMsg* msg, gfile& fp, int confno, int& pktmsgno) {
|
|||||||
// Calculate blocks
|
// Calculate blocks
|
||||||
uint endlen = msglen % 128;
|
uint endlen = msglen % 128;
|
||||||
uint blocks = 1+(msglen/128)+(endlen?1:0);
|
uint blocks = 1+(msglen/128)+(endlen?1:0);
|
||||||
sprintf(buf, "%u", blocks);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%u", blocks);
|
||||||
memcpy(hdr.blocks, buf, strlen(buf));
|
memcpy(hdr.blocks, buf, strlen(buf));
|
||||||
|
|
||||||
// Write padding spaces at the end if necessary
|
// Write padding spaces at the end if necessary
|
||||||
@ -560,7 +564,7 @@ int ExportQWK() {
|
|||||||
int pktmsgno = 0;
|
int pktmsgno = 0;
|
||||||
if (QWK->FirstConf())
|
if (QWK->FirstConf())
|
||||||
{
|
{
|
||||||
sprintf(replyfile, "%s%s.MSG", QWK->ExportPath(), QWK->BbsID());
|
gsprintf(PRINTF_DECLARE_BUFFER(replyfile), "%s%s.MSG", QWK->ExportPath(), QWK->BbsID());
|
||||||
fp.Fopen(replyfile, "wb");
|
fp.Fopen(replyfile, "wb");
|
||||||
if (fp.isopen())
|
if (fp.isopen())
|
||||||
{
|
{
|
||||||
|
@ -119,12 +119,13 @@ Line* _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::make_dump_msg
|
|||||||
|
|
||||||
int _count = 0;
|
int _count = 0;
|
||||||
char* _ptr = (char*)&_hdr;
|
char* _ptr = (char*)&_hdr;
|
||||||
for(;_count < sizeof(HudsHdr); _ptr+=16,_count+=16) {
|
for (;_count < sizeof(HudsHdr); _ptr+=16,_count+=16)
|
||||||
sprintf(buf, "%04X ", _count);
|
{
|
||||||
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%04X ", _count);
|
||||||
HexDump16(buf+7, _ptr, 16, HEX_DUMP2);
|
HexDump16(buf+7, _ptr, 16, HEX_DUMP2);
|
||||||
line = AddLine(line, buf);
|
line = AddLine(line, buf);
|
||||||
}
|
}
|
||||||
sprintf(buf, "%04X ", _count);
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), "%04X ", _count);
|
||||||
HexDump16(buf+7, _ptr, sizeof(HudsHdr)%16, HEX_DUMP2);
|
HexDump16(buf+7, _ptr, sizeof(HudsHdr)%16, HEX_DUMP2);
|
||||||
line = AddLine(line, buf);
|
line = AddLine(line, buf);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user