Skip to content
Snippets Groups Projects
Commit 0b889e78 authored by Paul Russo's avatar Paul Russo
Browse files

Fix usage of string constant.

git-svn-id: http://root.cern.ch/svn/root/trunk@24864 27541ba8-7e3a-0410-8455-c3a389f83636
parent 7a6e4d41
No related branches found
No related tags found
No related merge requests found
...@@ -6,29 +6,42 @@ ...@@ -6,29 +6,42 @@
* *
************************************************************************/ ************************************************************************/
#include <stdio.h> #include <cstdio>
#include <string.h> #include <cstring>
using namespace std;
// badinit.c // badinit.c
char *system = "WinNT"; const char* system = "WinNT";
//______________________________________________________________________________ //______________________________________________________________________________
void ls(char *path=0) void ls(const char* path = 0)
{ {
// --
char s[256];
s[0] = '\0';
#ifdef __CINT__ #ifdef __CINT__
char s[256] = (!strcmp(system, "WinNT")) ? "dir /w " : "ls "; if (!strcmp(system, "WinNT")) {
#else strcpy(s, "dir /w ");
char s[256] = "dir /w "; }
#endif else {
if (path) strcat(s,path); strcpy(s, "ls ");
// gSystem.Exec(s); }
printf("%s\n",s); #else // __CINT__
strcpy(s, "dir /w ");
#endif // __CINT__
if (path) {
strcat(s, path);
}
//gSystem.Exec(s);
printf("%s\n", s);
} }
int main() { int main()
for(int i=0;i<2;i++) ls(); {
return 0; for (int i = 0; i < 2; ++i) {
ls();
}
return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment