plutinosoft / Platinum

UPnP SDK

Home Page:http://plutinosoft.com/platinum

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deprecated gets used

TimmvonderMehden opened this issue · comments

many of the test programs use gets(), which is deprecated:

 http://www.cplusplus.com/reference/cstdio/gets/ :
 Compatibility
 The most recent revision of the C standard (2011) has definitively removed this function from its specification.
 The function is deprecated in C++ (as of 2011 standard, which follows C99+TC3).

better use gets_s, else, VS2015 and above won't compile.

affected files:
\Platinum\Source\Apps\FrameStreamer\main.cpp
\Platinum\Source\Apps\MediaConnect\main.cpp
\Platinum\Source\Apps\MediaCrawler\main.cpp
\Platinum\Source\Tests\FileMediaServer\FileMediaServerTest.cpp
\Platinum\Source\Tests\LightSample\LightSampleTest.cpp
\Platinum\Source\Tests\MediaRenderer\MediaRendererTest.cpp
\Platinum\Source\Tests\Simple\SimpleTest.cpp

change like this:

  • while (gets(buf)) {
  • while (gets_s(buf,256)) {

This doesn't work on OSX. So instead I choose:
fgets(buf, 256, stdin);