Listing 2 goto approach for handling error conditions

goto Approach (Ken Pugh's approach)

static int /* status */
general_routine ()
   {
    int status = STS_OK;
    
    if (<error condition 1>)
        {
        status = ERROR_CODE_1;
        goto label_01;
        }
    if (<error condition 2>)
        {
        status = ERROR_CODE_@;
        goto label_)01;
        }
    ...
    <more error checking>
    <finally do something>
label_01:
    return (status);
   }
/* End of File */