configure_file(xfreerdp.1.xml.in xfreerdp.1.xml @ONLY IMMEDIATE)
+ # the manpage generator helper tool is called by cmake.
+ # this does not work if we compile with any of the sanitizer options,
+ # therefore remove these from the CFLAGS for this specific target.
+ string(REGEX REPLACE "-fsanitize=[a-z]* " "" CUSTOM_C_FLAGS ${CMAKE_C_FLAGS})
add_executable(generate_argument_docbook generate_argument_docbook.c)
-
- target_link_libraries(generate_argument_docbook winpr)
-
+ set_property(TARGET generate_argument_docbook PROPERTY CMAKE_C_FLAGS ${CUSTOM_C_FLAGS})
add_custom_command(OUTPUT xfreerdp.1
COMMAND generate_argument_docbook
COMMAND ${CMAKE_COMMAND} -E copy
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
#include "../common/cmdline.h"
-#include <freerdp/log.h>
#define TAG FREERDP_TAG("generate_argument_docbook")
LPSTR tr_esc_str(LPCSTR arg, bool format)
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if(NULL == tmp)
{
- WLog_ERR(TAG, "Could not allocate string buffer.");
+ fprintf(stderr, "Could not allocate string buffer.\n");
exit(-2);
}
/* Copy character for character and check, if it is necessary to escape. */
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if(NULL == tmp)
{
- WLog_ERR(TAG, "Could not reallocate string buffer.");
+ fprintf(stderr, "Could not reallocate string buffer.\n");
exit(-3);
}
if (format)
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if(NULL == tmp)
{
- WLog_ERR(TAG, "Could not reallocate string buffer.");
+ fprintf(stderr, "Could not reallocate string buffer.\n");
exit(-4);
}
if (format)
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if(NULL == tmp)
{
- WLog_ERR(TAG, "Could not reallocate string buffer.");
+ fprintf(stderr, "Could not reallocate string buffer.\n");
exit(-5);
}
tmp[cs++] = '&';
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if(NULL == tmp)
{
- WLog_ERR(TAG, "Could not reallocate string buffer.");
+ fprintf(stderr, "Could not reallocate string buffer.\n");
exit(-6);
}
tmp[cs++] = '&';
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if(NULL == tmp)
{
- WLog_ERR(TAG, "Could not reallocate string buffer.");
+ fprintf(stderr, "Could not reallocate string buffer.\n");
exit(-7);
}
tmp[cs++] = '&';
fp = fopen(fname, "w");
if(NULL == fp)
{
- WLog_ERR(TAG, "Could not open '%s' for writing.", fname);
- return winpr_exit(-1);
+ fprintf(stderr, "Could not open '%s' for writing.\n", fname);
+ return -1;
}
/* The tag used as header in the manpage */
fprintf(fp, "<refsect1>\n");
* compatible XML */
if(elements < 2)
{
- WLog_ERR(TAG, "The argument array 'args' is empty, writing an empty file.");
+ fprintf(stderr, "The argument array 'args' is empty, writing an empty file.\n");
elements = 1;
}
for(x=0; x<elements - 1; x++)
fprintf(fp, "\t\t</variablelist>\n");
fprintf(fp, "\t</refsect1>\n");
fclose(fp);
- return winpr_exit(0);
+ return 0;
}