Let $S_n = X_1 + \cdots + X_n$ be the $n$th partial sum of an i.i.d. sequence of random variables. We describe the limiting behavior of \begin{equation*}\begin{split}T_n = \max_{1\leq i\leq n}(S_{i+\kappa(i)} - S_i), \\ U_n = \max_{0\leq i\leq n-k}(S_{i+k} - S_i), \\ W_n = \max_{0\leq i\leq n-k} \max_{1\leq j\leq k}(S_{i+j} - S_i) \\ \end{split}\end{equation*} and $V_n = \max_{0\leq i\leq n-k} \min_{1\leq j\leq k}(k/j)(S_{i+j} - S_i),$ for $k = \kappa(n) = \lbrack c \log n\rbrack$, and where $c > 0$ is a given constant. We assume that the random variables $X_i$ are centered and have a finite moment generating function in a right neighborhood of zero, and obtain among other results the full form of the Erdos-Renyi (1970) and Shepp (1964) theorems. Our conditions extend those of Deheuvels, Devroye and Lynch (1986) to cover a larger class of distributions.