Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/factory/FieldCreateFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <sstream>

#include <epicsString.h>
#include <epicsStdio.h>
#include <epicsMutex.h>
#include <epicsThread.h>

Expand Down Expand Up @@ -378,7 +379,8 @@ BoundedScalarArray::BoundedScalarArray(ScalarType elementType, size_t size)
string BoundedScalarArray::getID() const
{
char buffer[32];
sprintf(buffer, "%s<%zu>", ScalarTypeFunc::name(getElementType()), size);
epicsSnprintf(buffer, sizeof(buffer), "%s<%lu>",
ScalarTypeFunc::name(getElementType()), (unsigned long) size);
return string(buffer);
}

Expand All @@ -403,7 +405,8 @@ FixedScalarArray::FixedScalarArray(ScalarType elementType, size_t size)
string FixedScalarArray::getID() const
{
char buffer[32];
sprintf(buffer, "%s[%zu]", ScalarTypeFunc::name(getElementType()), size);
epicsSnprintf(buffer, sizeof(buffer), "%s[%lu]",
ScalarTypeFunc::name(getElementType()), (unsigned long) size);
return string(buffer);
}

Expand Down
3 changes: 2 additions & 1 deletion testApp/pv/performstruct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <testMain.h>
#include <epicsUnitTest.h>
#include <epicsStdio.h>

#include <pv/current_function.h>
#include <pv/pvData.h>
Expand Down Expand Up @@ -54,7 +55,7 @@ void buildMiss()
for(size_t i=0; i<1000; i++) {
// unique name each time to (partially) defeat caching
char buf[10];
sprintf(buf, "field%zu", i);
epicsSnprintf(buf, sizeof(buf), "field%lu", (unsigned long) i);

record.start();

Expand Down
Loading