Commit 4ce1dc09 authored by Bandana's avatar Bandana

Update persistentStorage.cpp

parent 652f007f
...@@ -705,7 +705,10 @@ void PUTT(char *key,char *value){ ...@@ -705,7 +705,10 @@ void PUTT(char *key,char *value){
n+=1; n+=1;
} }
ts[256]='\n'; ts[256]='\n';
n=open(strcat(add->filename,".txt"),O_WRONLY); char filename2[10];
strcpy(filename2,add->filename);
n=open(strcat(filename2,".txt"),O_WRONLY);
lseek(n,(add->lineno)*257,SEEK_SET); lseek(n,(add->lineno)*257,SEEK_SET);
lineno=100; lineno=100;
write(n,ts,257); write(n,ts,257);
...@@ -723,17 +726,17 @@ struct n2 * checkfile(struct n2 *h2,char *s){ ...@@ -723,17 +726,17 @@ struct n2 * checkfile(struct n2 *h2,char *s){
{ {
if(h2==NULL){ if(h2==NULL){
// printf("return \n"); printf("return \n");
return NULL; return NULL;
} }
else{ else{
// printf("%s = %s \n",h2->filename,s); printf("%s = %s \n",h2->filename,s);
if(strcmp(h2->filename,s)==0){ if(strcmp(h2->filename,s)==0){
// printf("if \n"); printf("if \n");
return h2;} return h2;}
else{ else{
h2=h2->pointer; h2=h2->pointer;
// printf("else \n"); printf("else \n");
} }
} }
} }
......
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