Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix #170 #205

Merged
merged 1 commit into from

3 participants

@Lyrositor
Collaborator

This closes #170. I have tested this on my own shard with an internal client. I have also thrown in a bit of more "correct" XHTML tags, just to avoid obsoletion in 2999.

Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCmd.cpp
@@ -565,7 +565,7 @@ uint8_t pfConsoleCmd::GetSigEntry( uint8_t i )
const char *pfConsoleCmd::GetSignature( void )
{
- static char string[ 256 ];
+ char* string = new char[256];
@branan Owner
branan added a note

I think the correct fix here is just char string[256];. This will be allocated on the stack each call (so it won't be shared), but it won't cause a leak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Lyrositor
Collaborator

I've switched to your suggestion, branan.

@Hoikas Hoikas merged commit 56994f2 into from
@Lyrositor Lyrositor referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Hoikas Hoikas referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Hoikas Hoikas referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@dpogue dpogue referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Lunanne Lunanne referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Deledrius Deledrius referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Deledrius Deledrius referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Lyrositor Lyrositor referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 8, 2012
  1. @Lyrositor

    Fix console documentation.

    Lyrositor authored
This page is out of date. Refresh to see the latest.
View
18 Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
@@ -688,7 +688,7 @@ class DocGenIterator : public pfConsoleCmdIterator
if(strncmp("SampleCmd",c->GetName(), 9) != 0)
{
- fprintf(fFile, "<P><I>%s </I><BR>%s </P>\n",c->GetSignature(),
+ fprintf(fFile, "<p><em>%s </em><br />%s </p>\n",c->GetSignature(),
c->GetHelp());
}
}
@@ -696,10 +696,11 @@ class DocGenIterator : public pfConsoleCmdIterator
{
// if(g->GetFirstCommand() != nil)
{
- fprintf(fFile, "<P><B><H%s>Command %sGroup %s </B></H2></P>\n",
+ fprintf(fFile, "<p><strong><h%s>Command %sGroup %s </strong></h%s></p>\n",
(depth > 0) ? "3" : "2",
(depth > 0) ? "Sub" :"" ,
- g->GetName());
+ g->GetName(),
+ (depth > 0) ? "3" : "2");
}
return true;
}
@@ -717,7 +718,7 @@ class BriefDocGenIterator : public pfConsoleCmdIterator
if(strncmp("SampleCmd",c->GetName(), 9) != 0)
{
- fprintf(fFile, "<I>%s.%s </I> - %s <BR>\n",fGrpName,c->GetSignature(),
+ fprintf(fFile, "<em>%s.%s </em> - %s <br />\n",fGrpName,c->GetSignature(),
c->GetHelp());
}
}
@@ -725,11 +726,14 @@ class BriefDocGenIterator : public pfConsoleCmdIterator
{
// if(g->GetFirstCommand() != nil)
{
- fprintf(fFile, "<BR>\n");
+ fprintf(fFile, "<br />\n");
if(depth <1)
strcpy(fGrpName, g->GetName());
else
{
+ pfConsoleCmdGroup *parentGrp;
+ parentGrp = g->GetParent();
+ strcpy(fGrpName, parentGrp->GetName());
strcat(fGrpName,".");
strcat(fGrpName,g->GetName());
}
@@ -758,7 +762,7 @@ PF_CONSOLE_CMD( Console, CreateDocumentation, "string fileName",
}
- fprintf(f, "<CENTER> <H2> Console Commands for Plasma 2.0 Client </H2> <I>Built %s on %s.</I></CENTER><BR>",
+ fprintf(f, "<span style=\"text-align: center;\"> <h2> Console Commands for Plasma 2.0 Client </h2> <em>Built %s on %s.</em></span><br />",
pnBuildDates::fBuildTime, pnBuildDates::fBuildDate );
DocGenIterator iter(f);
@@ -788,7 +792,7 @@ PF_CONSOLE_CMD( Console, CreateBriefDocumentation, "string fileName",
return;
}
- fprintf(f, "<CENTER> <H3> Console Commands for Plasma 2.0 Client </H3> <I>Built %s on %s.</I></CENTER><BR>",
+ fprintf(f, "<span style=\"text-align: center;\"> <h3> Console Commands for Plasma 2.0 Client </h3> <em>Built %s on %s.</em></span><br />",
pnBuildDates::fBuildTime, pnBuildDates::fBuildDate );
BriefDocGenIterator iter(f);
group = pfConsoleCmdGroup::GetBaseGroup();
View
2  Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCmd.cpp
@@ -565,7 +565,7 @@ uint8_t pfConsoleCmd::GetSigEntry( uint8_t i )
const char *pfConsoleCmd::GetSignature( void )
{
- static char string[ 256 ];
+ char string[256];
int i;
char pStr[ 128 ];
Something went wrong with that request. Please try again.