From c1073c4dd1c2597644c3ba2578e5890a3d2cd7a4 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 18 Oct 2010 13:23:07 +0200 Subject: [PATCH] Changed: #142 Replace atoi and sscanf by fromString when it's possible --- code/ryzom/client/src/interface_v3/sphrase_manager.cpp | 6 ++++-- code/ryzom/client/src/npc_icon.cpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp index bb215b30b..e25900f91 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp @@ -4686,12 +4686,14 @@ NLMISC_COMMAND(regenTickRange, "Emulate regen tick range locally for a memory sl { if (args.size() != 1 && args.size() != 2) return false; CSPhraseManager *pPM = CSPhraseManager::getInstance(); - const CSPhraseCom &phrase = pPM->getPhrase(atoi(args[0].c_str())); + uint32 phraseId; + NLMISC::fromString(args[0], phraseId); + const CSPhraseCom &phrase = pPM->getPhrase(phraseId); uint64 powerBitField = CSPhraseManager::getPhraseRequiredFlags(phrase); TGameCycle duration; if (args.size() >= 2) { - duration = (TGameCycle) atoi(args[1].c_str()); + NLMISC::fromString(args[1], duration); } else { diff --git a/code/ryzom/client/src/npc_icon.cpp b/code/ryzom/client/src/npc_icon.cpp index 4857a7ad0..7d03ede01 100644 --- a/code/ryzom/client/src/npc_icon.cpp +++ b/code/ryzom/client/src/npc_icon.cpp @@ -486,7 +486,8 @@ NLMISC_COMMAND(queryMissionGiverData, "Query mission giver data for the specifie { if (args.size() == 0) return false; - uint32 alias = atoi(args[0].c_str()); + uint32 alias; + NLMISC::fromString(args[0], alias); CNPCIconCache::getInstance().queryMissionGiverData(alias); //giver.setDescTransient();