Commit 092bbb3e authored by Ing. Jan Trávníček's avatar Ing. Jan Trávníček

aql: use static cast in handling of the result of malloc

parent e87d7a0a
......@@ -11,7 +11,7 @@ size_t ReadlinePromptHistory::esc_char_size = sizeof ( ReadlinePromptHistory::es
char * ReadlinePromptHistory::descape ( const char * buffer ) {
size_t l = strlen ( buffer );
char * dest = ( char * ) malloc ( ( l + 1 ) * sizeof ( char ) );
char * dest = static_cast < char * > ( malloc ( ( l + 1 ) * sizeof ( char ) ) );
char * ptr = dest;
for ( size_t i = 0; i < l; ++ i ) {
if ( buffer [ i ] == '\\' ) {
......@@ -34,7 +34,7 @@ char * ReadlinePromptHistory::descape ( const char * buffer ) {
char * ReadlinePromptHistory::escape ( const char * buffer){
size_t l = strlen ( buffer );
char * dest = ( char * ) malloc ( ( l * 2 + 1 ) * sizeof ( char ) );
char * dest = static_cast < char * > ( malloc ( ( l * 2 + 1 ) * sizeof ( char ) ) );
char * ptr = dest;
for ( size_t i = 0; i < l; ++ i ) {
size_t j = std::find ( esc_char, esc_char + esc_char_size, buffer [ i ] ) - esc_char;
......
Markdown is supported
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