Browse Source

Added a OS Branch to C-style functions in Parser.cpp

Former-commit-id: cfefaf429f
tempestpy_adaptions
PBerger 12 years ago
parent
commit
0113f5e6dc
  1. 13
      src/parser/Parser.cpp

13
src/parser/Parser.cpp

@ -7,6 +7,7 @@
#include "src/exceptions/FileIoException.h" #include "src/exceptions/FileIoException.h"
#include "src/exceptions/WrongFormatException.h" #include "src/exceptions/WrongFormatException.h"
#include "src/utility/OsDetection.h"
#include "log4cplus/logger.h" #include "log4cplus/logger.h"
#include "log4cplus/loggingmacros.h" #include "log4cplus/loggingmacros.h"
@ -172,17 +173,29 @@ void storm::parser::getMatchingSeparatorString(char* targetBuffer, uint_fast64_t
switch (lineEndings) { switch (lineEndings) {
case SupportedLineEndingsEnum::SlashN: { case SupportedLineEndingsEnum::SlashN: {
char source[] = " \n\t"; char source[] = " \n\t";
#ifdef WINDOWS
strncpy(targetBuffer, targetBufferSize, source, sizeof(source)); strncpy(targetBuffer, targetBufferSize, source, sizeof(source));
#else
strncpy(targetBuffer, source, targetBufferSize);
#endif
break; break;
} }
case SupportedLineEndingsEnum::SlashR: { case SupportedLineEndingsEnum::SlashR: {
char source[] = " \r\t"; char source[] = " \r\t";
#ifdef WINDOWS
strncpy(targetBuffer, targetBufferSize, source, sizeof(source)); strncpy(targetBuffer, targetBufferSize, source, sizeof(source));
#else
strncpy(targetBuffer, source, targetBufferSize);
#endif
break; break;
} }
case SupportedLineEndingsEnum::SlashRN: { case SupportedLineEndingsEnum::SlashRN: {
char source[] = " \r\n\t"; char source[] = " \r\n\t";
#ifdef WINDOWS
strncpy(targetBuffer, targetBufferSize, source, sizeof(source)); strncpy(targetBuffer, targetBufferSize, source, sizeof(source));
#else
strncpy(targetBuffer, source, targetBufferSize);
#endif
break; break;
} }
default: default:

Loading…
Cancel
Save