From 0113f5e6dc0a645c7e67eaab8aec193a65b29b3f Mon Sep 17 00:00:00 2001 From: PBerger Date: Sun, 16 Jun 2013 23:28:24 +0200 Subject: [PATCH] Added a OS Branch to C-style functions in Parser.cpp Former-commit-id: cfefaf429f332a3f74d0c688e791c4a947b8fca1 --- src/parser/Parser.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/parser/Parser.cpp b/src/parser/Parser.cpp index ae12cea9f..5ed957c17 100644 --- a/src/parser/Parser.cpp +++ b/src/parser/Parser.cpp @@ -7,6 +7,7 @@ #include "src/exceptions/FileIoException.h" #include "src/exceptions/WrongFormatException.h" +#include "src/utility/OsDetection.h" #include "log4cplus/logger.h" #include "log4cplus/loggingmacros.h" @@ -172,17 +173,29 @@ void storm::parser::getMatchingSeparatorString(char* targetBuffer, uint_fast64_t switch (lineEndings) { case SupportedLineEndingsEnum::SlashN: { char source[] = " \n\t"; +#ifdef WINDOWS strncpy(targetBuffer, targetBufferSize, source, sizeof(source)); +#else + strncpy(targetBuffer, source, targetBufferSize); +#endif break; } case SupportedLineEndingsEnum::SlashR: { char source[] = " \r\t"; +#ifdef WINDOWS strncpy(targetBuffer, targetBufferSize, source, sizeof(source)); +#else + strncpy(targetBuffer, source, targetBufferSize); +#endif break; } case SupportedLineEndingsEnum::SlashRN: { char source[] = " \r\n\t"; +#ifdef WINDOWS strncpy(targetBuffer, targetBufferSize, source, sizeof(source)); +#else + strncpy(targetBuffer, source, targetBufferSize); +#endif break; } default: