git.stg.codes
/
stg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f7b9fd9
)
Minor changes.
author
Maxim Mamontov
<faust.madf@gmail.com>
Sun, 18 Feb 2018 17:12:49 +0000
(19:12 +0200)
committer
Maxim Mamontov
<faust.madf@gmail.com>
Sun, 18 Feb 2018 17:12:49 +0000
(19:12 +0200)
projects/sgconf_xml/main.cpp
patch
|
blob
|
history
diff --git
a/projects/sgconf_xml/main.cpp
b/projects/sgconf_xml/main.cpp
index 2d8975733e02e14076ba382d1406881ec76af658..8c2ce593f9afbe0fccf10f066093359a8ae9a340 100644
(file)
--- a/
projects/sgconf_xml/main.cpp
+++ b/
projects/sgconf_xml/main.cpp
@@
-42,7
+42,6
@@
$Date: 2008/01/05 12:11:34 $
char fileName[FN_LEN];
char strReq[2048];
char fileName[FN_LEN];
char strReq[2048];
-//int ParseReply(void * data, SLIST * ans);
int ParseReply(void * data, list<string> * ans);
struct option long_options[] = {
int ParseReply(void * data, list<string> * ans);
struct option long_options[] = {
@@
-105,19
+104,17
@@
return pass;
//-----------------------------------------------------------------------------
void CreateRequest(REQUEST * req, char * r)
{
//-----------------------------------------------------------------------------
void CreateRequest(REQUEST * req, char * r)
{
-char str[10024];
r[0] = 0;
if (!req->strReq.empty())
{
r[0] = 0;
if (!req->strReq.empty())
{
+ char str[10024];
sprintf(str, "%s", req->strReq.const_data().c_str());
strcat(r, str);
return;
} else
{
sprintf(str, "%s", req->strReq.const_data().c_str());
strcat(r, str);
return;
} else
{
- FILE *f;
- f = NULL;
- f = fopen(fileName, "rt");
+ FILE *f = fopen(fileName, "rt");
if (!f)
{
printf("Can't open request file\n");
if (!f)
{
printf("Can't open request file\n");
@@
-246,18
+243,15
@@
printf(" </SetUser>\n\n");
printf(" <Message login=\"LOGIN\" msgver=\"1\" msgtype=\"1\" repeat=\"0\" repeatperiod=\"0\" showtime=\"0\" text=\"MESSAGE\" />\n");
}
//---------------------------------------------------------------------------
printf(" <Message login=\"LOGIN\" msgver=\"1\" msgtype=\"1\" repeat=\"0\" repeatperiod=\"0\" showtime=\"0\" text=\"MESSAGE\" />\n");
}
//---------------------------------------------------------------------------
-int main
(int argc, char **argv)
+int main(int argc, char **argv)
{
{
-int c;
-//int digit_optind = 0;
REQUEST req;
while (1)
{
REQUEST req;
while (1)
{
- //int this_option_optind = optind ? optind : 1;
int option_index = -1;
int option_index = -1;
- c = getopt_long(argc, argv, "s:p:a:w:f:r:", long_options, &option_index);
+
int
c = getopt_long(argc, argv, "s:p:a:w:f:r:", long_options, &option_index);
if (c == -1)
break;
if (c == -1)
break;
@@
-269,7
+263,6
@@
while (1)
case 'p': //port
req.port = ParseServerPort(optarg);
case 'p': //port
req.port = ParseServerPort(optarg);
- //req.portReq = 1;
break;
case 'a': //admin
break;
case 'a': //admin
@@
-290,7
+283,6
@@
while (1)
break;
case '?':
break;
case '?':
- //printf ("Unknown option \n");
break;
default:
break;
default:
@@
-309,7
+301,6
@@
if (optind < argc)
if (CheckParameters(&req) == 0)
{
if (CheckParameters(&req) == 0)
{
- //printf("Parameter needed\n");
Usage();
exit(PARAMETER_PARSING_ERR_CODE);
}
Usage();
exit(PARAMETER_PARSING_ERR_CODE);
}