Commit fe19e89b authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Rephrase buffer allocation/filling.

parent 7c531df4
......@@ -723,9 +723,9 @@ int fowPOSIXASYNCH ( const char *filename )
size_t l = strlen(filename) + strlen(message) + 2;
char *temp = xmalloc(l + 1);
strncpy(temp, (char *)afd->db->buffer, l);
temp[l] = '\0';
xdebug ( "filename=%s, put Open file message on buffer:\n%s,\t return",
filename, temp);
temp[l] = '\0';
xdebug("filename=%s, put Open file message on buffer:\n%s,\t return",
filename, temp);
free(temp);
}
......
......@@ -579,8 +579,6 @@ int fowPOSIXNONB ( const char *filename )
static long buffersize = 0;
int root = 0, id, iret, messageLength = 32;
char message[messageLength];
size_t l;
char *temp;
/* broadcast buffersize to collectors */
......@@ -621,13 +619,13 @@ int fowPOSIXNONB ( const char *filename )
if ( ddebug )
{
l = strlen ( filename ) + strlen ( message ) + 2;
temp = xmalloc (( l + 1 ) * sizeof ( char ));
strncpy ( temp, ( char * ) afd->db->buffer, ( size_t ) l );
temp[l] = '\0';
size_t l = strlen(filename) + strlen(message) + 2;
char *temp = xmalloc(l + 1);
strncpy(temp, (char *)afd->db->buffer, l);
temp[l] = '\0';
xdebug("filename=%s, put Open file message on buffer:\n%s,\t return",
filename, temp);
free ( temp );
filename, temp);
free(temp);
}
return id;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment