Memory allocation OpcUa_SnPrintfA

Questions regarding the use of the ANSI C SDK for Server or Client development or integration into customer products ...

Moderator: uasdkc

Post Reply
JeromeBos
Sr. Member
Sr. Member
Posts: 14
Joined: 09 May 2016, 15:31

Memory allocation OpcUa_SnPrintfA

Post by JeromeBos »

I can't find any documentation on the function OpcUa_SnPrintfA. Does it allocate memory like 'asprintf' or do I still need to explicitely allocate memory?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re: Memory allocation OpcUa_SnPrintfA

Post by Support Team »

Hello,

The macro is directly mapped onto the function snprintf, you need to allocate the needed buffer by yourself (see http://www.cplusplus.com/reference/cstdio/snprintf/).
Best regards
Unified Automation Support Team

JeromeBos
Sr. Member
Sr. Member
Posts: 14
Joined: 09 May 2016, 15:31

Re: Memory allocation OpcUa_SnPrintfA

Post by JeromeBos »

Thanks for the answer.

Fortunately I also discovered the UaProvider_CustomProvider_NodeIdCreate() function which also handles allocation and does pretty much what I needed. :)

Post Reply