We investigate the impact of detection uncertainties in the sensing information on the power-allocation policy that achieves the maximum capacity offered by a cognitive radio (CR) in a spectrum-sharing system. It is assumed that the transmit power of the secondary user can be adjusted based on soft-sensing information pertaining to the activity of the primary user in the secondary transmission region. In particular, considering an imperfect soft-sensing mechanism at the secondary system, we obtain the optimal power transmission policy in terms of false alarm and detection probabilities and under constraints on the average interference power at the primary receiver. Furthermore, we present a quantized sensing mechanism that considers only restricted levels of the sensing observations. Finally, we illustrate our analysis through numerical results and comparisons and explore the impact of imperfect spectrum sensing information on the performance of CR systems.