46,9 → 46,12 |
long est; |
static char afs_sig[] = "%RGB-1.0\n"; |
|
if(!h) DBG("saveparams: Null handle!"); |
|
est = strlen(expr[0])+strlen(expr[1])+strlen(expr[2])+strlen(expr[3]); |
est += strlen(afs_sig) + est/CHOPLINES + 4 + 8*6 + 1024 /*slop*/ ; |
est += strlen(afs_sig) + est/CHOPLINES + 4 + 8*6 + 64 /*slop*/ ; |
|
PIUNLOCKHANDLE(h); // should not be necessary |
if( !(e = PISETHANDLESIZE(h,est)) && (p = start = PILOCKHANDLE(h,false)) ){ |
p = cat(p,afs_sig); |
|
59,7 → 62,6 |
} |
|
/* expressions */ |
if(!e) |
for( i=0 ; i<4 ; ++i ){ |
if(r = expr[i]) |
for( n = strlen(r) ; n ; n -= chunk ){ |
79,9 → 81,14 |
p = cat(p,"(null expr)\n"); // this shouldn't happen |
*p++ = '\n'; |
} |
|
// *p = 0; dbg(start); |
|
PIUNLOCKHANDLE(h); |
if(!e) |
e = PISETHANDLESIZE(h,p - start); |
e = PISETHANDLESIZE(h,p - start); // could ignore this error, maybe |
}else{char s[100]; |
//alertuser("saveparams","couldn't resize (or lock) parameters!"); |
//sprintf(s,"est=%d e=%d ",est,e);dbg(s); |
} |
err: |
return e; |