Dwayne Hill appeals his convictions of second degree murder and use of a firearm to commit a felony. He assigns as error *175the trial court’s (1) granting the State leave to file an amended information without first providing appellant a preliminary hearing on count I, (2) overruling appellant’s motion to quash, (3) not applying credit for time served to appellant’s minimum sentence for purposes of determining parole eligibility, (4) failing to articulate the minimum sentence applicable to count I in appellant’s case, and (5) not ruling that it is a violation of due process to retroactively apply an unforeseeable judicial interpretation of statutory language. We affirm.
BACKGROUND
Louis Burchfield testified that he attended a party in Lincoln on Saturday, August 26 or 27, 1989. Sometime after midnight, a group of young males came to the party. The five young males left the party approximately half an hour after they had arrived. A short while after the five males were escorted from the party, a young man arrived at the party appearing frightened and excited, with blood on his face. He told the other partygoers that he had been assaulted outside the house by several young males and that they had taken his glasses.
Burchfield and one other partygoer walked toward the comer of 11th and F Streets to attempt to retrieve the man’s glasses. On the comer of 11th and F Streets, Burchfield and his companion met up with these males, and Burchfield’s companion fled and returned to the party to get more help. The group began insinuating that Burchfield was gay and told him they were going to beat him up, so he began to slowly back away from the intersection toward the house where the party was being held.
At that point, several more of the partygoers joined Burchfield in the confrontation with the group of young males. One of the young males was holding a stick and swinging it at the partygoers, presumably trying to keep them at bay. One of the partygoers charged the man with the stick and was struck twice before the stick broke. As Burchfield and another member of the party charged the man with the stick, another of the men from the party, J. Eric Jones, came running from behind Burchfield. Burchfield turned to make sure it was someone from the party and watched as Jones was shot and fell to the ground. Burchfield turned to the direction from which the shot *176had been fired and saw a man standing by Jones. The person standing over Jones then turned and fired twice at Burchfield. Burchfield testified that he heard five shots altogether. Burchfield’s version of the events was corroborated by Mark Greenwood, one of the hosts of the party.
Scott Joyce testified that during the early morning hours of August 27, 1989, he telephoned the 911 emergency service number because he saw a large number of people outside a house at 11th and F Streets and he thought there might be a fight. While Joyce was on the telephone with a 911 operator, he heard three shots fired outside.
Sgt. Joseph Wright was the Lincoln police officer dispatched to 11th and F Streets at about 4:30 a.m. regarding gunshots. Upon arriving, he found an individual lying on the ground on the east curb of 11th Street just north of F Street, clutching a stomach wound.
Dr. David L. Kutsch is a retired pathologist who performed an autopsy on Jones at Lincoln General Hospital. Kutsch testified that Jones had a gunshot wound to the right side of the abdomen approximately 3/s inches to the right of the navel. The bullet entered the right side of the abdomen, nicked a loop of the small intestine, and perforated the left common iliac artery. He described the injury to the artery as catastrophic and testified that if the artery had not been severed, Jones would have, in all likelihood, survived uneventfully. Kutsch further testified that the severing of the artery and the resultant loss of blood caused Jones to go into irreversible shock and that Jones was pronounced dead shortly after arriving at the hospital. Kutsch also identified the bullet that was taken from Jones’ body during the autopsy.
Det. Greg Sorensen of the Lincoln Police Department contacted appellant at the Omaha Police Division. Appellant gave Sorensen a statement implicating himself, following the reading of his Miranda rights, which Sorensen recorded. At trial, Sorensen identified a Smith & Wesson .38-caliber revolver which appellant identified as the handgun he had used to shoot Jones.
Prior to the case at bar, appellant was previously found guilty of second degree murder for shooting Jones. Appellant filed a *177motion for postconviction relief on March 24, 1995, alleging that his rights were violated under the Sixth Amendment to the U.S. Constitution and article I, § 11, of the Nebraska Constitution because his attorney failed to advise him that according to Neb. Rev. Stat. § 28-304 (Reissue 1995), he was not guilty of the crime of second degree murder because the act he committed lacked an essential element of the offense (malice). The trial court granted appellant’s motion for postconviction relief and granted a new trial because the information charging the appellant with second degree murder did not include malice as an element. The State appealed this decision, and this court summarily affirmed the decision without opinion, 248 Neb. xxiv (case No. S-95-980, Dec. 13, 1995). The State then filed a second amended information, charging appellant in count I with second degree murder under § 28-304(1) and in count II with use of a firearm to commit a felony under Neb. Rev. Stat. § 28-1205(1) (Reissue 1989).
Appellant then filed a motion to quash the second amended information because he was not given a preliminary hearing on count I of the second amended information, which motion was overruled. A jury trial was held, and after adducing evidence, the State rested. Appellant put on no evidence and moved for a directed verdict on counts I and II, which was denied. The jury returned verdicts of guilty on counts I and II, and the defendant filed a motion for new trial, which was denied as well. The trial court sentenced appellant to life imprisonment under count I of the information and to an indeterminate term of imprisonment of from 2 to 4 years under count II of the information, the sentences to be served consecutively. Appellant was given credit against count II for time spent in custody since February 22, 1996.
ASSIGNMENTS OF ERROR
Appellant assigns as error that (1) the trial court erred in granting the State leave to file an amended information without first providing appellant a preliminary hearing on count I, (2) the trial court erred in overruling appellant’s motion to quash, (3) the trial court erred in not applying credit for time served to appellant’s minimum sentence for purposes of determining parole eligibility, (4) the trial court erred in failing to articulate *178the minimum sentence applicable to count I in appellant’s case, and (5) the trial court erred in not ruling that it is a violation of due process to retroactively apply an unforeseeable judicial interpretation of statutory language.
STANDARD OF REVIEW
The purpose of a preliminary hearing under Neb. Rev. Stat. § 29-506 (Reissue 1995) is to ascertain whether or not a crime has been committed and whether or not there is probable cause to believe the accused committed it; it is not a trial of a person accused to determine his guilt or innocence, but is a procedural safeguard to prevent a person from being detained in custody without probable cause existing that the crime charged was committed by that person. State v. Sheldon, 179 Neb. 377, 138 N.W.2d 428 (1965), cert. denied 383 U.S. 930, 86 S. Ct. 938, 15 L. Ed. 2d 848 (1966).
A claim that a defendant was not accorded a preliminary hearing or waived it is determinable by a plea in abatement or a motion to quash. State v. Moss, 182 Neb. 502, 155 N.W.2d 435 (1968); State v. Brevet, 180 Neb. 616, 144 N.W.2d 210 (1966).
Regarding questions of law, an appellate court is obligated to reach a conclusion independent of the determinations reached by the trial court. State v. Williams, 253 Neb. 111, 568 N.W.2d 246 (1997); State v. Stubblefield, 249 Neb. 436, 543 N.W.2d 743 (1996).
A sentence imposed within statutory limits will not be disturbed on appeal absent an abuse of discretion by the trial court. State v. Schultz, 252 Neb. 746, 566 N.W.2d 739 (1997); State v. Merrill, 252 Neb. 510, 563 N.W.2d 340 (1997); State v. Earl, 252 Neb. 127, 560 N.W.2d 491 (1997); State v. Cook, 251 Neb. 781, 559 N.W.2d 471 (1997). An abuse of discretion takes place when the sentencing court’s reasons or rulings are clearly untenable and unfairly deprive a litigant of a substantial right and a just result. See, State v. McBride, 252 Neb. 866, 567 N.W.2d 136 (1997); State v. Merrill, supra; State v. Earl, supra; State v. Cook, supra.
ANALYSIS
Appellant’s first and second assignments of error, combined, assert that the district court erred in overruling his motion to *179quash the information due to the State’s failure to provide him a preliminary hearing. It should be noted at the outset that appellant was given a preliminary hearing as to count II of the information charging him with use of a weapon to commit a felony, and sufficient evidence was found to bind appellant over for trial. It should be further noted that appellant was granted a preliminary hearing as to the charge of second degree murder prior to his first conviction. The only element which was absent from the information at the time of Hill’s first preliminary hearing was the element of malice.
The failure to hold a preliminary hearing, as opposed to a challenge to the sufficiency of evidence at a preliminary hearing, may be raised by a motion to quash or a plea in abatement. State v. Brevet, 180 Neb. 616, 144 N.W.2d 210 (1966). In State v. Brevet, 180 Neb. at 620, 144 N.W.2d at 213, we stated that “[t]he proper method of objecting to trial in the district court for the insufficiency of a preliminary hearing, or the failure to provide one at all, is by motion to quash or a plea in abatement before an attack on the merits.” (Emphasis supplied.) The later case Kruger v. Brainard, 183 Neb. 455, 161 N.W.2d 520 (1968), modified State v. Brevet, supra, only as to the insufficiency of a preliminary hearing and did not modify the holding in Brevet as to the failure to hold a preliminary hearing.
The question, then, is whether appellant was accorded a preliminary hearing. “[T]he District Court is without jurisdiction to try on information one accused of committing a felony within the state unless the defendant is first accorded the privilege of a preliminary [hearing] or waives the same.” State v. Kelley, 211 Neb. 770, 775, 320 N.W.2d 455, 458 (1982). Clearly, appellant was provided a preliminary hearing, albeit upon a charge of second degree murder that omitted the element of malice.
“In a prosecution by information, the complaint and information must charge the same offense, but it is sufficient if the charge in the information is substantially the same as that alleged in the complaint. If this is so, a plea of no preliminary [hearing] on the ground of a variance between the complaint and the information is without force.”
Id. at 775-76, 320 N.W.2d at 458. In the instant case, the charge in the amended information is substantially the same as that in *180the original information, such that a second preliminary hearing was not required.
A preliminary hearing “is in no sense a trial of the person accused in regard to his guilt or innocence.” State v. Brevet, 180 Neb. at 619, 144 N.W.2d at 213. Rather, its purpose is limited to ascertaining whether or not a crime was committed and whether or not there is probable cause to believe the accused committed it. Id. Whether a charge is “substantially” the same may not be sufficient to give a defendant a fair trial, but certainly is sufficient to give the defendant a fair preliminary hearing.
Credit for Time Served
We have said that a sentence of imprisonment that is within the statutory limits will not be disturbed on appeal in the absence of abuse of discretion. State v. Cisneros, 248 Neb. 372, 535 N.W.2d 703 (1995); State v. Derry, 248 Neb. 260, 534 N.W.2d 302 (1995).
In State v. Anderson, 252 Neb. 675, 564 N.W.2d 581 (1997), Anderson pled guilty to second degree murder in 1988; in 1995, he was granted postconviction relief based on the failure of the State to include the element of malice in the charging information. He was then convicted of second degree murder in 1996 and appealed to this court, claiming that the sentencing court did not give him credit in regard to his prior life sentence. This court stated, citing State v. Lynch, 215 Neb. 528, 340 N.W.2d 128 (1983), that by its very nature, a life sentence is indefinite, and that in the case of a life sentence, it is impossible to impose punishment exceeding the term prescribed by statute. State v. Anderson, supra. This court went on to say that a criminal defendant convicted of first or second degree murder and sentenced to life in prison is not entitled to credit for time spent in custodial detention pending trial and sentence. Id. We also stated, citing State v. Mantich, 249 Neb. 311, 543 N.W.2d 181 (1996), that when a defendant receives a sentence consecutive to the life sentence which carries a maximum and minimum term, the defendant is entitled to receive credit for the time served against the consecutive sentence. State v. Anderson, supra.
The trial court followed exactly the holdings of State v. Anderson, supra; State v. Mantich, supra; and State v. Lynch, *181supra, in imposing the sentence in this case. Appellant’s assignments of error with regard to the sentence and credit for time served are, therefore, without merit.
Due Process
As to appellant’s contention that his due process rights were violated, we would point out that in State v. Lynch, supra, we held that a defendant sentenced to life imprisonment is not entitled to credit against a life sentence for time spent in custody awaiting trial. This decision predated in time all sentences in this case. Appellant’s fifth assignment of error, therefore, is without merit.
CONCLUSION
For the reasons previously stated in this opinion, we hold appellant’s assignments of error Nos. 1 and 2, that the trial court erred in granting the State leave to file an amended information without first providing appellant with a preliminary hearing on the amended charge and that the trial court overruled his motion to quash, to be without merit. We further hold that the failure to hold a preliminary hearing, as opposed to a challenge to the sufficiency of the evidence at the preliminary hearing, may be raised either by a plea in abatement or in a motion to quash. However, error in ruling on a plea in abatement or motion to quash alleging failure to hold a preliminary hearing is cured by a subsequent finding of guilt beyond a reasonable doubt by a jury.
Appellant’s contention that he should be given an indeterminate sentence of 10 years’ to life imprisonment is without merit. The matter of sentencing appellant was squarely within the discretion of the trial judge, and appellant’s life sentence clearly was not an abuse of discretion.
Appellant’s fifth assignment of error is also without merit for the reason that the holding of State v. Lynch, supra, that one sentenced to life in prison is not entitled to credit for. time served awaiting trial, predated in time all of the sentences in this case. This rule did not change from the date of the crime and the date of the final sentencing.
Affirmed.