diff options
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/acid/expr.c | 3 | ||||
-rw-r--r-- | src/cmd/db/format.c | 5 | ||||
-rw-r--r-- | src/cmd/vbackup/vnfs.c | 19 |
3 files changed, 19 insertions, 8 deletions
diff --git a/src/cmd/acid/expr.c b/src/cmd/acid/expr.c index 2330c430..61d5951e 100644 --- a/src/cmd/acid/expr.c +++ b/src/cmd/acid/expr.c @@ -855,11 +855,12 @@ ocand(Node *n, Node *res) { Node l, r; - res->store.fmt = l.store.fmt; + res->store.fmt = 'D'; res->op = OCONST; res->type = TINT; res->store.u.ival = 0; expr(n->left, &l); + res->store.fmt = l.store.fmt; if(bool(&l) == 0) return; expr(n->right, &r); diff --git a/src/cmd/db/format.c b/src/cmd/db/format.c index 08068e61..7a93bc5f 100644 --- a/src/cmd/db/format.c +++ b/src/cmd/db/format.c @@ -60,7 +60,7 @@ exform(int fcount, int prt, char *ifp, Map *map, int literal, int firstpass) char *fp; char c, modifier; int i; - ushort sh, *sp; + ushort sh; uchar ch, *cp; Symbol s; char buf[512]; @@ -205,7 +205,8 @@ exform(int fcount, int prt, char *ifp, Map *map, int literal, int firstpass) case 'R': if (literal) { - sp = (u16int*)(void*)˙ + u16int sp[2]; + memmove(&sp, &dot, 4); dprint("%C%C", sp[0], sp[1]); endline(); dotinc = 4; diff --git a/src/cmd/vbackup/vnfs.c b/src/cmd/vbackup/vnfs.c index cb9fdbf5..d4319c86 100644 --- a/src/cmd/vbackup/vnfs.c +++ b/src/cmd/vbackup/vnfs.c @@ -322,10 +322,14 @@ cryptinit(void) { uchar key[32], ivec[AESbsize]; int i; + u32int u32; - *(u32int*)sessid = truerand(); - for(i=0; i<nelem(key); i+=4) - *(u32int*)&key[i] = truerand(); + u32 = truerand(); + memmove(sessid, &u32, 4); + for(i=0; i<nelem(key); i+=4) { + u32 = truerand(); + memmove(key+i, &u32, 4); + } for(i=0; i<nelem(ivec); i++) ivec[i] = fastrand(); setupAESstate(&aesstate, key, sizeof key, ivec); @@ -793,6 +797,8 @@ cnodelookup(Ctree *t, Cnode **np, char *name) Nfs3Status cnodegetattr(Cnode *n, Nfs3Attr *attr) { + uint64 u64; + memset(attr, 0, sizeof *attr); if(n->read){ attr->type = Nfs3FileReg; @@ -805,7 +811,8 @@ cnodegetattr(Cnode *n, Nfs3Attr *attr) attr->size = 1024; attr->nlink = 10; } - attr->fileid = *(u64int*)n->handle; + memmove(&u64, n->handle, 8); + attr->fileid = u64; attr->atime.sec = n->mtime; attr->mtime.sec = n->mtime; attr->ctime.sec = n->mtime; @@ -817,6 +824,7 @@ cnodereaddir(Cnode *n, u32int count, u64int cookie, uchar **pdata, u32int *pcoun { uchar *data, *p, *ep, *np; u64int c; + u64int u64; Nfs3Entry ne; n = n->kidlist; @@ -842,7 +850,8 @@ cnodereaddir(Cnode *n, u32int count, u64int cookie, uchar **pdata, u32int *pcoun ne.name = n->name; ne.namelen = strlen(n->name); ne.cookie = ++cookie; - ne.fileid = *(u64int*)n->handle; + memmove(&u64, n->handle, 8); + ne.fileid = u64; if(nfs3entrypack(p, ep, &np, &ne) < 0) break; p = np; |