]> git.ozlabs.org Git - tonyb-yaboot.git/blobdiff - second/fs_reiserfs.c
Be explicit in order of evaluation in the reiserfs code
[tonyb-yaboot.git] / second / fs_reiserfs.c
index b0c3ac00ee6743c3c6a21c8173462921446be0c9..a312ced0d9efff213ea18a391e7d812c94690022 100644 (file)
@@ -218,7 +218,7 @@ block_read( __u32 blockNr, __u32 start, __u32 len, char *buffer )
          if ( *journal_table != 0xffffffff )
          {
               /* Search for the blockNr in cached journal */
-              j_len = le32_to_cpu(*journal_table++);
+              j_len = le32_to_cpu((*journal_table)++);
               while ( i++ < j_len )
               {
                    if ( le32_to_cpu(*journal_table++) == blockNr )
@@ -618,7 +618,10 @@ next_key( void )
               cache = CACHE( depth );
          else
          {
-              cache = read_tree_node( INFO->blocks[depth], --depth );
+              /* Save depth as using it twice as args to read_tree_node()
+               * has undefined behaviour */
+              __u16 d = depth;
+              cache = read_tree_node( INFO->blocks[d], --depth );
               if ( !cache )
                    return 0;
          }