mirror of
https://github.com/facebook/zstd.git
synced 2025-10-15 00:02:02 -04:00
Merge pull request #4157 from facebook/fix_result_c
fix incorrect pointer manipulation
This commit is contained in:
commit
751bf1ffd8
@ -10,7 +10,7 @@
|
||||
|
||||
#include "result.h"
|
||||
|
||||
char const* result_get_error_string(result_t result) {
|
||||
const char* result_get_error_string(result_t result) {
|
||||
switch (result_get_error(result)) {
|
||||
case result_error_ok:
|
||||
return "okay";
|
||||
@ -25,6 +25,6 @@ char const* result_get_error_string(result_t result) {
|
||||
case result_error_round_trip_error:
|
||||
return "round trip error";
|
||||
default:
|
||||
return "unknown error - " + result_get_error(result);
|
||||
return "unknown error";
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ static result_error_t result_get_error(result_t result) {
|
||||
return result.internal_error;
|
||||
}
|
||||
|
||||
char const* result_get_error_string(result_t result);
|
||||
const char* result_get_error_string(result_t result);
|
||||
|
||||
static result_data_t result_get_data(result_t result) {
|
||||
return result.internal_data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user