fixed ReadString() and throw_wrongchar()

This commit is contained in:
2022-04-19 14:25:53 +03:00
parent 4ac054d651
commit 3c8253d264
3 changed files with 11 additions and 17 deletions

View File

@@ -38,6 +38,7 @@ void test_dtsod(){
optime(__func__,1,({
printf("\e[96m-------------[test_dtsod]-------------\n");
Hashtable* dtsod;
char* s;
optime("deserialize",1,({
tryLast(DtsodV24_deserialize(text),r)
@@ -45,7 +46,6 @@ void test_dtsod(){
}));
print_dtsod(dtsod);
char* s;
optime("serialize",1,({
tryLast(DtsodV24_serialize(dtsod),r)
s=r.value.VoidPtr;
@@ -65,7 +65,6 @@ void test_dtsod(){
free(s);
FILE* f=fopen("messages.dtsod", "r");
printf("f: %p\n", f);
if(f==NULL){
perror("error ");
throw("can't open file");
@@ -77,6 +76,7 @@ void test_dtsod(){
fbuf[i++]=cc;
}
fbuf[i]='\0';
fclose(f);
printf("read %u chars", i);
Maybe rrr=DtsodV24_deserialize(fbuf);
if(rrr.errmsg) {